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

run a command in my .exe using the shell??

Status
Not open for further replies.

LuckyDuck528

Programmer
Dec 21, 2004
65
US
Hello All -

I have a VB6 program that I needs to call a .vbs script that will stop an Application Pool in IIS 6.0.

The vbs has to accept arguments from the cmd line and it works great when run alone.

However, when the VB executable runs and tries to call the Shell command below, I get an error after the "Stopping AppPool..." statment that says "Path Not Found". I'm assuming that means the path to my .vbs

So apparently this has to do with the shell32.dll?? I have no idea... anywyas, this is teh LAST part of my current project and any help getting this little bug worked out is greatly appreciated.

Thank you and hope you're having a great day! [smile]

Code:
Const strStopAppPool = "C:\....."

...

'Print saying you are going to stop the apppool
Open strLogFile For Append As #20
    Print #20, "Stopping App Pool... " & strAppPool
Close #20

'Stop the app Pool w/ arguments server and apppool name
strRunStop = strStopAppPool & " " & strServerName & " " & strAppPool
Call Shell(strRunStop, 1)

'Debugging statement (This does not print.. I get the error)
Open strLogFile For Append As #20
    Print #20, "AppPool Stopped"
Close #20
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top