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 Shell command without batch file FROM A specific folder 1

Status
Not open for further replies.

ThomasMatelart

Programmer
Apr 17, 2001
14
BE
Hello,

I would like start a dos command without use a batch file.

so, I use VBA.Shell(<Command>)

where <Command> = C:\A\Test.exe "FileName1" "FileName2"

I have a problem.
The Test.exe application must run in the folder of the application, but if i use this way, the command is running from the current folder.

What can i do ?

Thomas


 
Use the ChDrive and ChDir methods to change the current drive and path.
___
[tt]
ChDrive "C:" 'change drive
ChDir "C:\A" 'change directory
Shell "C:\A\Test.exe ..." 'your command string[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top