newbie needs help with wshShell.run command 
Author Message
 newbie needs help with wshShell.run command

i'm a cut and paste scripter, and having problems converting what i've found
on MS.com, the newsgroups, and the WWW for my own use.

i've got this line at the beginning of my script. not quite sure what it
does, but from what i can tell i need to have it, so it's there.

    Set wshshell = Wscript.CreateObject("Wscript.Shell")

then i've got this code. 2 issues here

    if bld="62600.0000" then goto PATCH
    else if bld<"62600.0000" then wshShell.run ("\\server\share\ie
6\flat\win32\en\ie6setup.exe /q", 1, True)
    end if

as is, the code bombs out at the G in goto with an "expected statement"
error. i'm so pathetic at coding, i can't even use a goto statement.

so then i modified the code to skip the goto

    if bld<"62600.0000" then wshShell.run ("\\server\share\ie
6\flat\win32\en\ie6setup.exe /q", 1, True)
    end if

this bombs out and says i can't use paraentheses when calling a sub. i found
documentation for the wshShell.run command and it uses paraentheses - ????

any/all help is greatly appriciated. TIA.

-murph



Wed, 23 Jun 2004 06:24:59 GMT  
 newbie needs help with wshShell.run command

That is because script engine figures you are calling a sub. Either take out parentheses or state it like: success  =  wshShell.run ("\\server\share\ie6\flat\win32\en\ie6setup.exe /q", 1, True).

As for the goto, create a sub, or function (if you want to return a result).  And use it as:

bld = "62600.0000"
If not bld = "62600.0000" then
    wshShell.run "\\server\share\ie6\flat\win32\en\ie6setup.exe /q", 1, True
Else: Call Patch (Param_if any)
End If
..................
..................
Function Patch(Param_if any)
..........
..........
End Function

Quote:

> i'm a cut and paste scripter, and having problems converting what i've found
> on MS.com, the newsgroups, and the WWW for my own use.

> i've got this line at the beginning of my script. not quite sure what it
> does, but from what i can tell i need to have it, so it's there.

>     Set wshshell = Wscript.CreateObject("Wscript.Shell")

> then i've got this code. 2 issues here

>     if bld="62600.0000" then goto PATCH
>     else if bld<"62600.0000" then wshShell.run ("\\server\share\ie
> 6\flat\win32\en\ie6setup.exe /q", 1, True)
>     end if

> as is, the code bombs out at the G in goto with an "expected statement"
> error. i'm so pathetic at coding, i can't even use a goto statement.

> so then i modified the code to skip the goto

>     if bld<"62600.0000" then wshShell.run ("\\server\share\ie
> 6\flat\win32\en\ie6setup.exe /q", 1, True)
>     end if

> this bombs out and says i can't use paraentheses when calling a sub. i found
> documentation for the wshShell.run command and it uses paraentheses - ????

> any/all help is greatly appriciated. TIA.

> -murph



Wed, 23 Jun 2004 08:24:42 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP:wshshell.run and the > command

2. Running COMMAND.COM with WshShell.Run

3. Proffesional Help Needed: Unwanted Security Prompt W/ WshShell.run from local html

4. Complex WshShell.Run Commands

5. Executing with WshShell.run command.

6. Syntax for running a command using WshShell

7. WshShell.Run command string length limit?

8. Using a variable within WshShell object and Run method (newbie at work)

9. WshShell.Run (Newbie Problem)

10. limits on WshShell.Run()? Need good reference manual

11. WshShell.Run vs WshShell.Exec

12. runas with WshShell.Exec versus WshShell.Run

 

 
Powered by phpBB® Forum Software