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!

Error in Script

Status
Not open for further replies.

theinvid

Technical User
May 24, 2002
33
0
0
US
I'm getting a error Line 15, Char 50, Error Expected end of statement, Code 800A0401. What's missing? Thanks.

'**** Update Win2k to SP4 ************************
'*************************************************

'**** Map Drive **********************************
Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "Z:", "\\mcad01\update$"
'*************************************************
'**** Verify Current SP version ******************

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegRead "HKLM\Software\Microsoft\Windows NT\CurrentVersion\CSDVersion"
If REG_SZ = "Service Pack 3" or "Service Pack 2" or "Service Pack 1" Then
WshShell.Run "runas /user:domain\administrator "z:\win2k_sp4\w2ksp4_EN.exe" | sanur.exe password"
end script
 
Hello theinvid,

[1] Have to assign, probably REG_SZ is the variable name, as the holder of that info from regread.

[2] uniformizing the case of string for comparision in order to play safe.

[3]quots pair-up doubtfully in the .run line.

Base on these superficial observation, I would try:
Code:
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
REG_SZ=WshShell.RegRead("HKLM\Software\Microsoft\Windows NT\CurrentVersion\CSDVersion")
If lcase(REG_SZ) = lcase("Service Pack 3") or lcase("Service Pack 2") or lcase("Service Pack 1") Then
 WshShell.Run "runas /user:domain\administrator z:\win2k_sp4\w2ksp4_EN.exe | sanur.exe password"

end if
Only that I am not exactly sure the mechanism of your piping encryted password. But, that is not a scripting problem.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top