Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disconnect networks path after script job

Status
Not open for further replies.

heimly

Technical User
Jul 22, 2010
5
NO
I wish to disconect nettwork's path after the job is finiched.

I have make 2 scripts that work fine but i wish merge it.

The first is:
Dim WshNetwork
Dim objShell

Set WshNetwork.CreateObject ("WScript.Network")
WshNetwork.MapNetworkDrive "O:", "\\Servername\Shere",,"username", "Password"

Set objShell = CreateObject ("WScript.shell")
objShell.Run "%comspec% /c C: cd logs & dir dir >O:\text.txt
WScript.

The Second is:

Dim WshNetwork
Set WshNetwork.CreateObject ("WScript.Network")
WshNetwork.RemoveNetworkDrive "O:"

Is it posible to do it ?

Thanks for any help
Erik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top