Disconnecting and reconnecting automatically

  • Thread starter Thread starter Tewfik Lobbos
  • Start date Start date
T

Tewfik Lobbos

I need to automatically disconnect a drive (i:) when
shutting down win2000, and to reconnect it again at startup.
The reason is that the startup process doesn't complete
automatically when the connected drive is not present.

The command:
net use * /d /yes
doesn't work in autoexec.bat . Is it possible to incorporate
it in the shutdown process ? And what would be the command
to reconnect i: ?

Any help would be appreciated.
 
I use the following when I need to connect a drive via either logon script
or startup file:

net use i: /d
net use i: \\servername\sharename
 
I worked on your idea, and I came up with this. I created
i.bat containing one line:

@if exist \\computername\c\autoexec.bat net use i:
\\computername\c /persistent:no > nul

I added i.bat to the startup, and that's it. With
/persistent:no , I don't need to disconnect the drive at
shutdown. It's all automatic now.

I put i.bat in the path, so that if the second computer
starts after this one, I just have to issue the command "i"
to get reconnected.

Thanks, Richard.


Richard G. Harper said:
I use the following when I need to connect a drive via either logon script
or startup file:

net use i: /d
net use i: \\servername\sharename

--
Richard G. Harper [MVP Shell/User] (e-mail address removed)
* In fond memory ... Alex, you shall be sorely missed
* http://www.aumha.org/alex.htm

Tewfik Lobbos said:
I need to automatically disconnect a drive (i:) when
shutting down win2000, and to reconnect it again at startup.
The reason is that the startup process doesn't complete
automatically when the connected drive is not present.

The command:
net use * /d /yes
doesn't work in autoexec.bat . Is it possible to incorporate
it in the shutdown process ? And what would be the command
to reconnect i: ?

Any help would be appreciated.
 
Glad I was able to help you find a solution.

--
Richard G. Harper [MVP Shell/User] (e-mail address removed)
* In fond memory ... Alex, you shall be sorely missed
* http://www.aumha.org/alex.htm



Tewfik Lobbos said:
I worked on your idea, and I came up with this. I created
i.bat containing one line:

@if exist \\computername\c\autoexec.bat net use i:
\\computername\c /persistent:no > nul

I added i.bat to the startup, and that's it. With
/persistent:no , I don't need to disconnect the drive at
shutdown. It's all automatic now.

I put i.bat in the path, so that if the second computer
starts after this one, I just have to issue the command "i"
to get reconnected.

Thanks, Richard.


Richard G. Harper said:
I use the following when I need to connect a drive via either logon
script
or startup file:

net use i: /d
net use i: \\servername\sharename

--
Richard G. Harper [MVP Shell/User] (e-mail address removed)
* In fond memory ... Alex, you shall be sorely missed
* http://www.aumha.org/alex.htm

Tewfik Lobbos said:
I need to automatically disconnect a drive (i:) when
shutting down win2000, and to reconnect it again at startup.
The reason is that the startup process doesn't complete
automatically when the connected drive is not present.

The command:
net use * /d /yes
doesn't work in autoexec.bat . Is it possible to incorporate
it in the shutdown process ? And what would be the command
to reconnect i: ?

Any help would be appreciated.
 
Back
Top