Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: My VBS login script kept failing


01 Nov 2012   #1

Windows 7 64bit
 
 
My VBS login script kept failing

Okay, here's my VBS login script for using SELECT CASE to set default printer.
Code:
SELECT CASE usrName
    CASE "user1"
        WshNetwork.SetDefaultPrinter HP4100
    CASE "user2"
        WshNetwork.SetDefaultPrinter HP4250N1
    CASE "user3"
        WshNetwork.SetDefaultPrinter HP4250N2
    CASE "user4"
        WshNetwork.SetDefaultPrinter HP4250N5
    CASE "user5" OR "user6" OR "user7"
        WshNetwork.SetDefaultPrinter HP4250N6
        Wscript.Echo usrName & " in printer #6"
    CASE "user8" OR "user9"
        WshNetwork.SetDefaultPrinter HPCol3600
    CASE "user10" OR "user11"
        WshNetwork.SetDefaultPrinter HP4250N4
    CASE "user12"
        'user12 uses her local printer so there is no need to set default network printer
    DEFAULT
        WshNetwork.SetDefaultPrinter XR5550
        Wscript.Echo usrName & " in default printer"
END SELECT
The problem is, user13 kept defaulting to HP4250N6 instead of the XR5550 printer. I did the Wscript.Echo and it even showed the user13 pass through into this CASE which is NOT correct. Will someone show me what's wrong with my code? Thanks!

My System SpecsSystem Spec
.

Reply

 My VBS login script kept failing




Thread Tools



Similar help and support threads for2: My VBS login script kept failing
Thread Forum
Login script problems Network & Sharing
Auto Login Script For Wifi Hotspots? Network & Sharing
I Need Help To Reorder The Context Menu Script In Script Form? Customization
VBS script: Cannot find script engine General Discussion
Login Script Help Network & Sharing
Runing once an script before any user login Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 02:01 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33