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

Can someone point me to a reference manual that would have helped
with the following problem?  I called WshShell.Run as follows:

TestLog = "log.txt"
GoldenLog = "C:\SQZ\dev\Tests\Controls\Combo\GoldenSimple.txt"
diffResult =
"C:\SQZ\dev\Tests\Controls\RegressLogs\logs\Combo\Simple\Simplediff.txt"

 diffCmd = "%comspec% /c fc /L /N " & TestLog & " " & GoldenLog
 diffCmd = DiffCmd & " > " & diffResult

 res = Wsh.Run(diffCmd, 0, true)

This invocation failed, displaying the message:

"A device attached to the system is not functioning" (code 8007001F)

If I changed diffResult to be much shorter:

diffResult = "diff.txt"

Then the Run invocation worked fine.  So there is a limit on the length of
string the Run method can handle or the number of directories in a path
for redirecting output that %comspec% can handle or some other limit.

Does anyone know of a good reference manual that would describe these
limits so I could avoid tracking them down through experimentation?



Mon, 16 Dec 2002 03:00:00 GMT  
 limits on WshShell.Run()? Need good reference manual

I'm not aware of any reference source that covers this, but there was
a recent thread in one of these newsgroups about this. The upshot is
that the command line limit for the Run method is around 516
characters, give or take a couple. However, if the command line is run
under %comspec% then the line limit may shorten to as little as 128
characters, depending on the OS and system configuration. By the way,
these same limitations also apply to the Wscript.Arguments collection.
The easy workaround for the Run method limitations is to write lengthy
command lines to a batch file, which can sustain at least 1000
characters per line depending on OS, and then Shell.Run the batch file
instead.


: Can someone point me to a reference manual that would have helped
: with the following problem?  I called WshShell.Run as follows:
:
: TestLog = "log.txt"
: GoldenLog = "C:\SQZ\dev\Tests\Controls\Combo\GoldenSimple.txt"
: diffResult =
:
"C:\SQZ\dev\Tests\Controls\RegressLogs\logs\Combo\Simple\Simplediff.tx
t"
:
:  diffCmd = "%comspec% /c fc /L /N " & TestLog & " " & GoldenLog
:  diffCmd = DiffCmd & " > " & diffResult
:
:  res = Wsh.Run(diffCmd, 0, true)
:
: This invocation failed, displaying the message:
:
: "A device attached to the system is not functioning" (code 8007001F)
:
<snip>



Mon, 16 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. WshShell.Run command string length limit?

2. A Good VB Language Reference Manual?

3. Need VBSRCIPT Reference Manual Download

4. Need VBSRCIPT Reference Manual Download

5. Help: Manual or Reference on Logon Script needed

6. need VB for DOS Reference Manual

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

8. Need good JScript an VBScript reference guide

9. newbie needs help with wshShell.run command

10. need a good javascript reference

11. WshShell.Run vs WshShell.Exec

12. runas with WshShell.Exec versus WshShell.Run

 

 
Powered by phpBB® Forum Software