Sterling wrote:
Quote:
I am trying to run a command line command from a script with the
WScript.Shell command and the entire script executes fine except this
one part.
It does not error out, and the command executes fine from a command
line so I know I have the syntax correct. What I am thinking (since
I inherited the server it is running on) is that there is some
security setting preventing this command from executing.
Also, the script works correctly, shell command and all, on my
personal workstation.
Does anyone know what security setting (I have combed through local
security policy and searched this site to no avail) might affect this?
Thanks in advance. |
You must provide the details of what your script attempts to do via the
WshShell.Run method (there is no WScript.Shell command - that's the progid
used to create an instance of a WshShell object which has a Run method.
The most likely problem is that the command line you build via script is
*not* the same as the command line you type and run via a console window
(cmd.exe instance). For debugging purposes, always build the command line
to execute as the value of a variable the you can display
(msgbox/wscript.echo) for visual inspection for correctness before passing
it to the Run method.
Not that things executed via the Run method won't necessarily throw a script
error. If it executes and returns an error via an exit code, you must use
the bWaitOnReturn True/False argument (3rd) Run method and call it as a
function that returns a value. The value returned will be the exit code of
the process executed. The Run method itself won't throw an error unless is
is unable to run what you ask or you make some syntactic error in the method
call (like wrong number or type of arguments)...
--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.