tags:

views:

31

answers:

4

Hello I want to make a batch file from the below given procedure.. my original directory was C:/Users/Suvin..I changed the Directory to C:/AnimationApp.. After this i setted the path as set path=C:\bada\1.0.0b3\Tools\Toolchains\Win32\bin%path%C:\bada\1.0.0b3\Include..Then i setted the environmenat variables as set CPLUS_INCLUDE_PATH=C:\bada\1.0.0b3\Include.. after this is executed my commands to make an executable file from commnd prompt. Now could any body help me that how to make a batch file from above procedure. Thanks

A: 

For a batch file like the one you described, you can simply enter all of the commands you used manually, one on each line.

TM
Suppose if a different user places that file on a different drive..Then in that case i will have to use the command set OLD_PATH=%CD%..i think..But what in case a diff user has his SDK also installed on a different drive..for eg my SDK is installed in C drive so my path is for C drive..what in case if a user has his SDk installed somehere else..Wot to be done in that case..??
Suvin
A: 

just create a new file witha. .bat extension, and type the commands exactly as you typed them on the command line.

atk
A: 

DOS/Windows batch files are just sequences of commands. There are some special constructs you can use such as GOTO and REM that are not usual commands and useful for batch files.

So you would just enter your commands in a text file as such:

REM My cool batch
REM 2010.09.04
cd C:\AnimationApp

And so on and so forth. If you have a more specific question, please clarify.

sims
Suppose if a different user places that file on a different drive..Then in that case i will have to use the command set OLD_PATH=%CD%..i think..But what in case a diff user has his SDK also installed on a different drive..for eg my SDK is installed in C drive so my path is for C drive..what in case if a user has his SDk installed somehere else..Wot to be done in that case..??
Suvin
A: 

Open a new file and call it something with a .bat extension. Add the below text as the command you wish to execute and execute the file by typing the name on the command line.

pushd C:\AnimationApp
set PATH=C:\bada\1.0.0b3\Tools\Toolchains\Win32\bin%path%C:\bada\1.0.0b3\Include
set CPLUS_INCLUDE_PATH=C:\bada\1.0.0b3\Include
call <command to execute on command line>

Here is a link for batch file commands.

linuxuser27
Suppose if a different user places that file on a different drive..Then in that case i will have to use the command set OLD_PATH=%CD%..i think..But what in case a diff user has his SDK also installed on a different drive..for eg my SDK is installed in C drive so my path is for C drive..what in case if a user has his SDk installed somehere else..Wot to be done in that case..??
Suvin
There are many 'standard' environment variables in windows. `%SystemDrive%` with get you the drive letter, e.g. 'C:', `%ProgramFiles%` will get you the Program Files directory, and `%USERNAME%` will get you the user who is currently logged in. You can do all sorts of logic within a batch file. However, if you start to get complicated I recommend switching over to PowerShell.
linuxuser27