Scripts won't run in XP 
Author Message
 Scripts won't run in XP

Hello All,

I have several scripts that run file in 98SE, Me, 2K, and
NT4, but they do not run in XP (nothing happens when I run
them). All OS's except XP have been upgraded to
WSH/VBScript 5.6.

Here's an example:

*********************************************************
Option Explicit
  Dim objWshShell, objExec1, objArgs

  Set objWshShell = WScript.CreateObject("WScript.Shell")
  Set objArgs = WScript.Arguments

  If objArgs.Count = 0  Then
    WScript.Echo "1st run"
  ElseIf objArgs(0) = "2ndBoot" Then
    With WScript
      .Sleep 100
      .Echo "2nd run"
      .Quit
    End With
  End If

' Write the reg entry
objWshShell.RegWrite "HKCU\Software\Microsoft\Windows\Curre
ntVersion\RunOnce\Re-entrant", "C:\Scripts\Re-entrant\Re-
entrant.vbs 2ndBoot", "REG_SZ"

' Reboot the system
  objWshShell.Run Chr(34)
& "..\Utilities\RestartWindows.exe" & Chr(34), 1, True
*********************************************************

Thanks in advance for any help.

Bill
.



Mon, 03 Jan 2005 23:09:41 GMT  
 Scripts won't run in XP
It appears to be OK; does the registry entry not show up?  And does
RestartWindows.exe run OK on XP if you run it by itself?

--
Please respond in the newsgroup.  I've still got unread email from the
week Win95 was released, if that tells you anything.
http://www.bittnet.com/winremote
http://www.bittnet.com/scripting


Quote:
> Hello All,

> I have several scripts that run file in 98SE, Me, 2K, and
> NT4, but they do not run in XP (nothing happens when I run
> them). All OS's except XP have been upgraded to
> WSH/VBScript 5.6.

> Here's an example:

> *********************************************************
> Option Explicit
>   Dim objWshShell, objExec1, objArgs

>   Set objWshShell = WScript.CreateObject("WScript.Shell")
>   Set objArgs = WScript.Arguments

>   If objArgs.Count = 0  Then
>     WScript.Echo "1st run"
>   ElseIf objArgs(0) = "2ndBoot" Then
>     With WScript
>       .Sleep 100
>       .Echo "2nd run"
>       .Quit
>     End With
>   End If

> ' Write the reg entry
> objWshShell.RegWrite "HKCU\Software\Microsoft\Windows\Curre
> ntVersion\RunOnce\Re-entrant", "C:\Scripts\Re-entrant\Re-
> entrant.vbs 2ndBoot", "REG_SZ"

> ' Reboot the system
>   objWshShell.Run Chr(34)
> & "..\Utilities\RestartWindows.exe" & Chr(34), 1, True
> *********************************************************

> Thanks in advance for any help.

> Bill
> .



Tue, 04 Jan 2005 02:01:16 GMT  
 Scripts won't run in XP
Thanks for the quick reply. It's not just this script, I
just included it as an example. All my scripts are not
running.

Quote:
>-----Original Message-----
>It appears to be OK; does the registry entry not show
up?  And does
>RestartWindows.exe run OK on XP if you run it by itself?

>--
>Please respond in the newsgroup.  I've still got unread
email from the
>week Win95 was released, if that tells you anything.
>http://www.bittnet.com/winremote
>http://www.bittnet.com/scripting



>> Hello All,

>> I have several scripts that run file in 98SE, Me, 2K,
and
>> NT4, but they do not run in XP (nothing happens when I
run
>> them). All OS's except XP have been upgraded to
>> WSH/VBScript 5.6.

>> Here's an example:

*********************************************************

- Show quoted text -

Quote:
>> Option Explicit
>>   Dim objWshShell, objExec1, objArgs

>>   Set objWshShell = WScript.CreateObject
("WScript.Shell")
>>   Set objArgs = WScript.Arguments

>>   If objArgs.Count = 0  Then
>>     WScript.Echo "1st run"
>>   ElseIf objArgs(0) = "2ndBoot" Then
>>     With WScript
>>       .Sleep 100
>>       .Echo "2nd run"
>>       .Quit
>>     End With
>>   End If

>> ' Write the reg entry

objWshShell.RegWrite "HKCU\Software\Microsoft\Windows\Curre
Quote:
>> ntVersion\RunOnce\Re-entrant", "C:\Scripts\Re-
entrant\Re-
>> entrant.vbs 2ndBoot", "REG_SZ"

>> ' Reboot the system
>>   objWshShell.Run Chr(34)
>> & "..\Utilities\RestartWindows.exe" & Chr(34), 1, True

*********************************************************

- Show quoted text -

Quote:

>> Thanks in advance for any help.

>> Bill
>> .

>.



Tue, 04 Jan 2005 02:21:07 GMT  
 Scripts won't run in XP

Quote:

> Thanks for the quick reply. It's not just this script, I
> just included it as an example. All my scripts are not
> running.

Windows XP comes with WSH 5.6, so it looks like you WSH install is corrupt.

Try the following (create a System Restore Point first maybe):

Locate the file %windir%\inf\wsh.inf (inf is a hidden folder), right click,
select "Install".

--
torgeir



Tue, 04 Jan 2005 02:38:18 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Simple script won't run on certain user's PC

2. Ghostscript won't run from script.

3. VBS Scripts won't run, bad association?

4. Remote Admin Scripts won't run

5. scripts won't run on 2k prof

6. Logon Date/Time Script Won't Run

7. Script won't run with WSCRIPT/CSCRIPT

8. Login Script won't Run

9. Logon Script won't run in Windows 98

10. script won't run....Please help!

11. Logon Date/Time Script Won't Run

12. logon script won't run

 

 
Powered by phpBB® Forum Software