Go Back   PCMech Forums > Windows Support > Windows Legacy Support (XP and earlier)

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 07-12-2006, 09:51 PM   #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.
24giovanni is offline   Reply With Quote
Old 07-12-2006, 09:53 PM   #2
glc
Forum Administrator
Staff
Premium Member
 
glc's Avatar
 
Join Date: May 2000
Location: Joplin MO
Posts: 37,786
c:\docume~1\admini~1\prac1
glc is offline   Reply With Quote
Old 07-13-2006, 11:35 AM   #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.
edfair is offline   Reply With Quote
Old 07-13-2006, 12:03 PM   #4
Member (9 bit)
 
Join Date: Mar 2005
Posts: 326
tks guys
24giovanni is offline   Reply With Quote
Old 07-13-2006, 03:08 PM   #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
24giovanni is offline   Reply With Quote
Old 07-13-2006, 05:15 PM   #6
glc
Forum Administrator
Staff
Premium Member
 
glc's Avatar
 
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.
glc is offline   Reply With Quote
Old 07-13-2006, 06:39 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.
edfair is offline   Reply With Quote
Old 07-13-2006, 09:21 PM   #8
glc
Forum Administrator
Staff
Premium Member
 
glc's Avatar
 
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.
glc is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:09 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2