Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Vbs script equivalent of the net use */delete /yes command

2,188 views
Skip to first unread message

BookerT

unread,
Nov 26, 2008, 11:12:40 AM11/26/08
to
I want to make sure that all persistent connections are set to not be
remembered before Istart removing and mapping drives.

What are the vbs comand equivalents to set the persistent connections
to off

James Whitlow

unread,
Nov 26, 2008, 11:20:50 AM11/26/08
to
"BookerT" <ch...@mierbo.com> wrote in message
news:73abff10-038c-435f...@c1g2000yqg.googlegroups.com...

See this page for information. There is a VBScript example at the bottom
of the page.

http://msdn.microsoft.com/en-us/library/8kst88h6(VS.85).aspx


BookerT

unread,
Nov 26, 2008, 11:38:00 AM11/26/08
to
On Nov 26, 11:20 am, "James Whitlow" <jwhitlow.60372...@bloglines.com>
wrote:

I have the WshNetwork.RemovenetworkDrive, but on some computers , that
does not seem to remove drives where the computer was set using the
net use /persisitent:yes command. I would always get a local device
name has a remembered connection to another network resource.
I had a wscript.sleep time pause of 10 seconds after removing my
drives, but even with that, when trying to map, I would get this
error.

Once i went to the computer and typed in at the command prompt
net use /persistent:no then the next time I restarted and logged on,
the error went away.

So I wanted to do the equivalent in my vbs script to make sure all
persistent connections were removed as the wshNetwork.Removenetwork
Drive with the true, and true parameters did not seem to work

James Whitlow

unread,
Nov 26, 2008, 11:55:48 AM11/26/08
to
"BookerT" <ch...@mierbo.com> wrote in message
news:58215ff4-0cff-410c...@q9g2000yqc.googlegroups.com...

> I have the WshNetwork.RemovenetworkDrive, but on some computers , that
> does not seem to remove drives where the computer was set using the
> net use /persisitent:yes command. I would always get a local device
> name has a remembered connection to another network resource.
> I had a wscript.sleep time pause of 10 seconds after removing my
> drives, but even with that, when trying to map, I would get this
> error.
>
> Once i went to the computer and typed in at the command prompt
> net use /persistent:no then the next time I restarted and logged on,
> the error went away.
>
> So I wanted to do the equivalent in my vbs script to make sure all
> persistent connections were removed as the wshNetwork.Removenetwork
> Drive with the true, and true parameters did not seem to work

Are you specifying True for both 'bForce' and 'bUpdateProfile'? If not,
give it a try, something like:

Set oWNT = CreateObject("WScript.Network")
oWNT.RemoveNetworkDrive "Z:", True, True

RemoveNetworkDrive Method:
http://msdn.microsoft.com/en-us/library/d16d7wbf(VS.85).aspx


0 new messages