Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
is there a way to run programs using a batch file? i want to just double click on the batch file and have certain programs open up, like... windows media player for example and notepad for example just by clicking on the batch file. i can do the directories for it, i just need the synatx if this is possible. thanks!
FBI Agent
AIM: EliteAssassin187

Sure,
A batch file basically [among other things] does the same with a line like:
notepad my.txt
as typing it at the prompt and pressing ENTER.
BTW, notepad ain't DOS and if you're using XP, that ain't DOS either.
The default batch processor in XP is cmd.exe, which will do the job.
M2
If at first you don't succeed, you're about average.

hmmm... well i can do it running notepad but is there a... ok, nm. i got it. so the first thing you put in it the location of the exacutable and the second one is the location of the file you're opening with the exe.
i was just planning on using it to open like yahoo and MSN or something when i wanna talk with people, however, i think i can find a lot more usefull things than that now but i'll have to test them out to see if they actually work. thanks a lot Mechanix2Go!
FBI Agent
AIM: EliteAssassin187

well it only works with certain programs, so you'll usually have to set up the location.
FBI Agent
AIM: EliteAssassin187

thanks for your help but it hasnt helped, i can alredy write code for opening two programs but this one doesnt like it i think i need to start it in a different folder, as i said in my first post!

You've got two issues.
1. The path. If an executable is in the path, you can run it from anywhere.
2. The path you want to be working in.
If the files you want to work with are in:
d:\mystuff
you'd want to start your batch with:
d:
cd \mystuff
start "" someprog.exe myfile.wksHTH
M2
If at first you don't succeed, you're about average.

![]() |
Delete text in .txt files...
|
path problems with dos
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |