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

Batch File 1

Status
Not open for further replies.

turborob

Programmer
Dec 10, 2000
51
0
0
GB
Only one question, how do i do it, a batch file..
i have done an auto run cdr.., if the autorun fails i have been told to do a batch file for the user to run, and that it will run an .exe file on the cdr.
How Please !!!?
Thanks....Rob..
 
A Batch file in the ole DOS days. Would go something like this.

Lets say you have a program called 123.exe located in directory hello off the root drive (c:)

the path to it would look like this:

c:\hello\123.exe

Your batchfile could be right on the root directory - lets call it batch.bat

Open notepad,

type

@echo off
cls
cd hello
123.exe


Then save as batch.bat save into your c:
and if you typed batch - it would automatically take you to the hello directory - and run 123.exe

You can follow this for any batch file you wish to do - and get much more extensive at that.



**If you found my post or other's posts helpful, please let us know by clicking the helpful link on our post section.

Stuart
 
FYI,

Your AUTOEXEC.BAT is a batch file... All files with the BAT extension are batch files. They still are handy and since Java.exe runs in DOS, I'm still using batch files to start my DOS Session in a special directory. Yes I go back to BD (Before DOS) when CP/M was on a PC!

Generally, anything you can do on a DOS/command line can be done in a batch file. Just remember: one command to a line and @ before a command hides the command if ECHO is on (default). That is why @ECHO OFF is usually the first line in a batch file.
Brian
BRBecker20@yahoo.com
 
schase,
thanks for pointing out that can be done in notepad. I've still been dropping to a dos prompt and using the copy con command to create batch files. Not that I've used them much now that windows allows me to click on any file I want. I just go find the file with the funny icon and that is usually the *.exe file.
hg
 
Heck me too - after using DOS for so long - WIN95 was a lesson in frustration :)

Stuart
 
I should probably note

When you save - click save as - in filename put whatever you want followed by .bat (i.e. batch.bat )

In box "save as type" select *.*

Otherwise it will try to read it as a text file.

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top