I searched board and Shell is covered extensively, however it didn't work for me, so I post in a hope that someone will shed a light on my problem.
I have a batch file on a app server that runs some commands. It works fine if I run it directly.
When I run it like this in VB: result = Shell(myFile), it returns process id, but code within batch file is not executed. VB dll I'm working on is currently on my PC but will reside on IIS server.
I'm using UNC path and thought that was a problem, mapped drive and used that but code in batch file is still is not executed.
I also tried to use ShellExecute API. That didn't work either.
Another thing I tried from the sample on this board is to use WSript but it didn't work too.
Dim oWsh As Variant
Set oWsh = CreateObject("WScript.Shell")
oWsh.CurrentDirectory = "\\MyServer\FolderName\"
oWsh.Run "My_Batch_File.cmd", 0, True
At this point I'm ready to pull my hair out. Simple operation but just won't work.
Any ideas on how to force code in batch file to execute?
Thanks much
I have a batch file on a app server that runs some commands. It works fine if I run it directly.
When I run it like this in VB: result = Shell(myFile), it returns process id, but code within batch file is not executed. VB dll I'm working on is currently on my PC but will reside on IIS server.
I'm using UNC path and thought that was a problem, mapped drive and used that but code in batch file is still is not executed.
I also tried to use ShellExecute API. That didn't work either.
Another thing I tried from the sample on this board is to use WSript but it didn't work too.
Dim oWsh As Variant
Set oWsh = CreateObject("WScript.Shell")
oWsh.CurrentDirectory = "\\MyServer\FolderName\"
oWsh.Run "My_Batch_File.cmd", 0, True
At this point I'm ready to pull my hair out. Simple operation but just won't work.
Any ideas on how to force code in batch file to execute?
Thanks much