|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (9 bit)
Join Date: Mar 2005
Posts: 326
|
Batch question
I am trying to run a batch job in DOS to execute a file located at
c:\documents and settings\administrator\prac1 and the executable is called typedos. I am having trouble with the syntax and I was hoping to get some help. Here is what I am using for syntax in my batch file echo off cls c:\documents and settings\administrator\prac1 typedos cd\batch menu.bat exit Batch is the directory in which my batch files are located. I appreciate any help. |
|
|
|
|
|
#2 |
|
Forum Administrator
Staff
Premium Member
Join Date: May 2000
Location: Joplin MO
Posts: 37,786
|
c:\docume~1\admini~1\prac1
|
|
|
|
|
|
#3 |
|
Member (11 bit)
Join Date: Feb 2003
Location: Tucker Ga. USA
Posts: 1,305
|
You've got choices:
echo off cls c:\docume~1\admini~1\prac1\typedos cd \batch menu which will call the program from wherevery you happen to be Better would be to put c:\batch in a path command in autoexec.bat so the menu and the batch to access your typedos would execute without having to switch to the directory. in \batch create the file typedos.bat containing echo off cls cd \doc..~1\ad...~1\pr... typedos cd \ menu Both effectively do the same thing, one moves to the directory where the program exists, one doesn't. |
|
|
|
|
|
#4 |
|
Member (9 bit)
Join Date: Mar 2005
Posts: 326
|
tks guys
|
|
|
|
|
|
#5 |
|
Member (9 bit)
Join Date: Mar 2005
Posts: 326
|
hears another I am having trouble with. Everything works fine but I can't get the sound part of it to work.
Here is my syntax: @echo off cls cd\ cd batch type 8.txt cd\ cd sounds ohno cd\ cd batch menu.bat Any help is greatly appreciated. TIA |
|
|
|
|
|
#6 |
|
Forum Administrator
Staff
Premium Member
Join Date: May 2000
Location: Joplin MO
Posts: 37,786
|
If "ohno" is not an executable file, that is not going to work. You have to invoke a media player with the right syntax to play that file - assuming it's a wav file.
Try (path) mplayer2 (path) ohno.wav Assuming this is Win9x and you have Windows Media Player 6.4 installed. A tip when writing batch files - have a command window open and test each line individually before writing it into the batch file. Another tip - for efficiency, you do not have to cd\ then cd to a directory - all you have to do is cd\directory. Last edited by glc; 07-13-2006 at 05:21 PM. |
|
|
|
|
|
#7 |
|
Member (11 bit)
Join Date: Feb 2003
Location: Tucker Ga. USA
Posts: 1,305
|
I would suspect that the sound card is going to need drivers loaded by config.sys. Usual step is for the correct drivers ot load during installation from a driver floppy. And the card may load other drivers from the autoexec.bat.
Once the drivers are in you would run the executable as GLC mentions, the executable and the file to execute on the same line. GLC is correct about the shortcut ways of moving around the directory structure. I had suggested moving back through root as a diagnostic procedure. When you do that, any failure will leave you at the place you last moved to and the failure is in the next line. The same thing applies to running programs. You can call most programs from anywhere in the directory structure but if there are problems you then have to figure out where you came from and where you are going. By moving to the directory holding the program any failure is in that directory. As you become more familiar with navigation you will begin to understand the differences. Don't get discouraged. All this stuff will become automatic in a couple of weeks. |
|
|
|
|
|
#8 |
|
Forum Administrator
Staff
Premium Member
Join Date: May 2000
Location: Joplin MO
Posts: 37,786
|
If you are running the batch file in a command window in Windows, the sound card drivers should already be loaded.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|