-
Windows Logon Script
I have the following batch file that I use to map drives. I need to change this to vbscript as a number of users that need to use it have had the command prompt disabled. I have no experience at all with VB so could someone translate this for me:
Code:
if exist \\server1\folder1\%username%\*.* goto NET
if exist \\server1\folder2\%username%\*.* goto NET
if exist \\server2\%username%$\*.* goto NET2
goto DONE
:NET
net use /persistent:no
net use k: "\\server1\Shared Area 1"
net use p: \\server1\Admin1
net use t: \\server1\Admin2
net use w: "\\server1\Shared Area 2"
goto DONE
:NET2
net use /persistent:no
net use k: "\\server1\Shared Area 1"
net use w: "\\server1\Shared Area 2"
goto DONE
:DONE
exit
Many thanks for your help.
-
Re: Windows Logon Script
ShellExecute the .bat file.
-
Re: Windows Logon Script
Wouldn't this way still run the batch in command prompt? As mentioned im my previous post a number of users have command prompt disabled, so when the batch is run the message 'The command prompt has been disabled by your administrator. Press any key to continue...' and the batch file is not run.
Thanks
-
Re: Windows Logon Script
I don't know if that disables the prompt itself (the "DOS box") or if it keeps cmd.exe from running. Since I'm not admin of this computer I can't change things to check it out, but maybe you have a computer you can try it on.
Otherwise, If Dir("\\server1\folder1\%username%\*.*") > ""
will simulate your if exist lines, but you'll have to get help on the net use lines from someone else.