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

Mapkey Pointing to Batch File

  • Thread starter Thread starter Guest
  • Start date Start date
Status
Not open for further replies.
G

Guest

Guest
I am trying to create a mapkey that opens an external application. In the Record Mapkey > OS Script dialog box, I have the command:



D:\proefiles\toolbox\purgedrive.bat



This runs a batch file that opens a program called purgedrive.exe. Here are the contents of the batch file:



@echo off

REM *** Start Purge Drive

set D:\Program Files\PurgeDrive

start purgedrive.exe

exit



When I run the mapkey, I get the following error in the DOS window that pops up:



Environment variable D:\Program not defined



I've played around with the batch file, such as using D:\Progra~1\PurgeDrive and adding to my PATH environment variable the path to the directory, but to no avail.



Any suggestions on how this might be solved?



Thanks!
 
SET is for setting environment variables. CD changes directories. If you aren't sure of the DOS commands, type help at the command prompt for a list of commands. Type help <command name> to get a detailed description of any specific command.
 
Ah, you are right! I changed set d:\... to cd d:\... and it works now.



Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top