We help IT Professionals succeed at work.
Get Started

Cannot run .vbs without prefixing "Cscript" since xp sp3 upgrade

klwn
klwn asked
on
1,993 Views
Last Modified: 2012-05-05
Hi there,

We run a script during logon that moves printers from our old printserver to our new printserver. The script works fine until we started testing windows xp service pack3.
Everytime a .vbs is launched from within our login script we get a windows script host pop up saying "Please run this scrip using cscript"

We are setting cscript as our default script launcher in the login script. Can anyone help? Code below:-
Line 12 is when the windows scripting host msg pops up. This works fine in XP SP2!

Thanks in advance
1> if not exist %SystemRoot%\system32\prnmgr copy %logonserver%\netlogon\moveprinter\prnmgr.vbs %SystemRoot%\system32
2> if not exist %SystemRoot%\system32\con2prt.exe copy %logonserver%\netlogon\moveprinter\con2prt.exe %SystemRoot%\system32
3> if not exist %SystemRoot%\system32\prnadmin.dll copy %logonserver%\netlogon\moveprinter\prnadmin.dll %SystemRoot%\system32
4>  
5> if exist %temp%\printers.txt del %temp%\printers.txt
6> if exist %temp%\parseprint.txt del %temp%\parseprint.txt
7> if exist %temp%\printout.txt del %temp%\printout.txt
8>
9> %systemroot%\system32\regsvr32.exe /s %systemroot%\system32\prnadmin.dll >nul
10>
11> CScript //H:CScript //S 1>nul 2>nul 
12> prnmgr -l >%temp%\printers.txt
13> 
14> find "PrinterName" %temp%\printers.txt >%temp%\printout.txt
15> 
16> FOR /F "tokens=2,2 delims=: " %%i in (%temp%\printout.txt) do @echo %%i>>%TEMP%\parseprint.txt
17> 
18> FOR /F %%i in (%TEMP%\parseprint.txt) do if "%%i"=="\\printserver\X001" prnmgr -dc -b "\\printserver\X001" && con2prt /c "\\printserver2k3\XE01"

Open in new window

Comment
Watch Question
Top Expert 2009
Commented:
This problem has been solved!
Unlock 1 Answer and 22 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE