Net use in Login script

  • Thread starter Thread starter Anthony
  • Start date Start date
A

Anthony

How do I create a small .vbs file that includes the
correct syntax of the net use command to map several
shares to drive letters (Win2K Pro)?

For example, Ive tried net use f: \\win2kSrv\downloads AND
net use f: \\192.96.48.1\downloads in a .vbs file without
success. I keep getting an error: end of statement
expected at character 9.

Any suggestions?
 
-----Original Message-----
How do I create a small .vbs file that includes the
correct syntax of the net use command to map several
shares to drive letters (Win2K Pro)?

For example, Ive tried net use f: \\win2kSrv\downloads AND
net use f: \\192.96.48.1\downloads in a .vbs file without
success. I keep getting an error: end of statement
expected at character 9.

Any suggestions?
.
Your syntax looks correct, try putting your command line
in a .bat file
 
WSH can do a lot in terms of OS functions. I use MS Jscript (*.js) in
WSH, and I map drives like the below example. U can use this or look
up the syntax for VBscript in the WSH documentation.

---------------------------------------------------------------------------
var sh= WScript.CreateObject('WScript.Shell');
var net= WScript.CreateObject('WScript.Network');

net.MapNetworkDrive("u:", "\\\\server\\share",false, "userid",
"password");

net.RemoveNetworkDrive ("u:", true, true);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top