Oh, OK. The command explorer.exe simply (re)starts the Windows interface.
You could *add* another command to open the Explorer window:
explorer.exe %userprofile%\documents
Dismissing network drives when unplugged
-
- Administrator
- Posts: 78666
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Dismissing network drives when unplugged
Best wishes,
Hans
Hans
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Dismissing network drives when unplugged
TX
Will try it in due course.
Cheers
Will try it in due course.
Cheers
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Dismissing network drives when unplugged
Still gotta test John's last theory, but happy to say I now have a fully working script that clear the disconnected drives and reloads the explorer window. I thought I'd cover all bases with the original Net Use * command and the kill explorer.
TX all for your assistance.
@echo OFF
net use * /DELETE /Y
taskkill /f /IM explorer.exe
START explorer.exe
START explorer.exe %userprofile%\documents
TX all for your assistance.
@echo OFF
net use * /DELETE /Y
taskkill /f /IM explorer.exe
START explorer.exe
START explorer.exe %userprofile%\documents
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 78666
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- PlatinumLounger
- Posts: 5427
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Dismissing network drives when unplugged
Theory??Rudi wrote:Still gotta test John's last theory...
See below the third screen grab.
"The previous commands are not persistent, this means that the minute you reboot your PC the shares will disappear from your computer. To get the shares to survive a reboot, you need to add use the persistent switch."
John Gray
If you are having problems with solitude, you are not alone.
If you are having problems with solitude, you are not alone.
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Dismissing network drives when unplugged
TX John.
I will look into it. (I want to test it while at home)
I will look into it. (I want to test it while at home)
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Dismissing network drives when unplugged
Hi John,
According to the network technicians, the mappings are not persistent. The other thing is that I don't reboot my PC when I go home; I simply close the lid and it sleeps. The taskkill is fortunately working quite well now. TX for your advice.
According to the network technicians, the mappings are not persistent. The other thing is that I don't reboot my PC when I go home; I simply close the lid and it sleeps. The taskkill is fortunately working quite well now. TX for your advice.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- PlatinumLounger
- Posts: 5427
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: Dismissing network drives when unplugged
Ah - if you don't power off your laptop, then all bets are off...!
John Gray
If you are having problems with solitude, you are not alone.
If you are having problems with solitude, you are not alone.