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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to translate a logon script from batch to vbscript

Status
Not open for further replies.

FutureL

Technical User
Jan 15, 2005
9
0
0
GB
Hi,
I am in the process of creating my own home network, and started writting a logon script in the old batch langugge and I want to translate it to VBscript because I understand that as it's a newer langugge it is capable of doing much more complex things. So could someone translate this whole script for me in vbscript.
Thanks
Code:
@echo off
echo ------------------------------------------------------------
echo The Denny Network Logon Script 2005 version 1.0
echo ------------------------------------------------------------

REM **** Display Welcome Messages ****

echo Welcome To The Denny Network!
echo You Are On %COMPUTERNAME%, And You Are Running %os%
echo ------------------------------------------------------------
echo Starting Logon Script ...
echo ------------------------------------------------------------

REM **** Main Logon script ****

echo Hello %USERNAME%, Now Loading Your Persanal Settings...
echo Please Wait While This Script Runs...
echo You Will Be Logged On Shortly...

echo ------------------------------------------------------------

echo Refreshing Network Drives...
net use I: /delete
net use S: /delete
net use P: /delete

echo Mapping Network Drives...
NET USE I: \\LEONSPC\home
NET USE S: \\LEONSPC\SharedDocs
NET USE P: \\LEONSPC\Shared

echo ------------------------------------------------------------

echo Copying Files...

IF "%USERNAME%" == "Leon"  GOTO :Lcopy
IF "%USERNAME%" == "Nipsi"  GOTO :Ncopy
IF "%USERNAME%" == "Chrisi"  GOTO :Ccopy

:Lcopy
xcopy "P:\Shared.lnk" "\\leonspc\Users\Leon.LEONSPC\desktop" /c /k /r /i /q /y
xcopy "S:\SharedDocs.lnk" "\\leonspc\Users\Leon.LEONSPC\desktop" /c /k /r /i /q /y
GOTO :printersetup

:Ncopy
xcopy "P:\Shared.lnk" "\\leonspc\Users\Nipsi\desktop" /c /k /r /i /q /y
xcopy "S:\SharedDocs.lnk" "\\leonspc\Users\Leon.LEONSPC\desktop" /c /k /r /i /q /y
GOTO :printersetup

:Ccopy
xcopy "P:\Shared.lnk" "\\leonspc\Users\Chrisi\desktop" /c /k /r /i /q /y
xcopy "S:\SharedDocs.lnk" "\\leonspc\Users\Leon.LEONSPC\desktop" /c /k /r /i /q /y
GOTO :printersetup

:printersetup

echo ------------------------------------------------------------

IF "%COMPUTERNAME%" == "LEONSPC"  GOTO :PrintersOnLeonspc
IF "%COMPUTERNAME%" == "NIPSI"  GOTO :PrintersOnNipsi

:PrintersOnNipsi
echo Connecting To HP OfficeJet 2110 (Nipsi's Printer)...
rundll32 printui.dll,PrintUIEntry /in /n \\Nipsi\OfficeJet2110 /y

echo Connecting To HP LaserJet 2100 (Leon's Printer)...
rundll32 printui.dll,PrintUIEntry /in /n \\Leonspc\LaserJet2100

echo Connecting To HP DeskJet 3650 (Leon's Printer)...
rundll32 printui.dll,PrintUIEntry /in /n \\Leonspc\DeskJet3650

GOTO :logon

:PrintersOnLeonspc
echo Connecting To HP LaserJet 2100 (Leon's Printer)...
rundll32 printui.dll,PrintUIEntry /in /n \\Leonspc\LaserJet2100 /y

echo Connecting To HP DeskJet 3650 (Leon's Printer)...
rundll32 printui.dll,PrintUIEntry /in /n \\Leonspc\DeskJet3650

GOTO :logon

:logon
echo ------------------------------------------------------------

echo Finished! Thanks For Your Patience
echo You Are Now Being Logged On To This Computer...

echo ------------------------------------------------------------

echo Network Managed And Created by Leon Denny 2005
GOTO :DONE


:DONE
 
Try doing some of the code yourself, and then you'll get a lot more help. You usually get better responses if you do at least some of the work rather than asking for a total freebie.

What do you want to do that can't be done in standard batch programming?

Lee
 
Okay Thanks,
What I want to do is load users individual themes automacticly so they don't have t click ok, and I want the script to create profiles for new users who have never logged on to the computer before.
 
Sounds like you have some complex stuff to learn about Windows scripting.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top