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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with wshell.run

Status
Not open for further replies.

cglinn

Programmer
Sep 3, 2003
44
US
I am having the following problem:

I had a web application using ASPExec on a WinNT server to run a batch file located on the server. We recently migrated the application to a Windows 2000 server. The ASPExec component stopped working. From what I've seen ASPExec doesn't work too well in Win2k. Anyway, I have been trying to use WSCRIPT.Shell to run the batch file.

The process gets kicked off, but hangs (I can see the process in Task Manager).

Code:

Dim wshell, intReturn
Set wshell = CreateObject("WScript.Shell")
intReturn = wshell.run("cmd /k e:\QSL_LITE_DPC\nightly\dpc_dbcreate_manual.bat,1,True")
set wshell = nothing

I have checked the permissions on the folder where the bat file is located. The bat file calls a couple of .exe's in the same location. I can see the first one get called in Task Manager, but it just sits there and doesn't do anything.

Any suggestions?
 
Hello cglinn,

Probably just the same problem as what I had seen a couple of thread away... How about change the switch of cmd? Also mind the delimitation of string and arguments.
[tt]
intReturn = wshell.run("cmd /[red]c[/red] e:\QSL_LITE_DPC\nightly\dpc_dbcreate_manual.bat[red]"[/red],1,True[COLOR=red yellow] [/color])
[/tt]
regards - tsuji
 
Tsuji -

Thanks for the reply. I have tried it with "/c" instead of "/k" and I get the same results. As far as the quotes go, I actually had it correct in the code and typed it wrong in the post.

Any other ideas?

 
If you execute the command exactly the way you have it coded from the command line does it work?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Yes it does. I've also tried the same exact code in a VB application and it works.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top