|
-
Nov 10th, 2003, 03:17 PM
#1
Thread Starter
Hyperactive Member
Create a file using a batch (.bat) file?
Hey
I want to create a batch file that will create a file named : "settings.dat" and in this file it will contain :
[GEN]
Firstuse=True
How can I do this?
Thanks
-
Nov 10th, 2003, 03:41 PM
#2
You can do it with 2.
The first, name it 1.bat has this line
2.bat > settings.dat
and in 2.bat put in this
@echo [GEN]
@echo Firstuse=True
when you run 1.bat it executes 2.bat and places 2.bats output to settings.dat
-
Nov 11th, 2003, 07:55 AM
#3
Thread Starter
Hyperactive Member
Thanks that works..But is there a way to do this with one batch file?
-
Nov 12th, 2003, 02:01 AM
#4
Place the following in a batch file:
rem @echo off
> Settings.dat echo [GEN]
>> Settings.dat echo Firstuse=True
rem pause
The first rem, will turn the response on and off to hide the response, take the rem away.
The second will simply pause it, take away the rem to pause the code.
This will replace the file Settings.dat with whatever you place after the echo part, to keep adding stuff to the file, add the line >> Settings.dat echo to the file and what you want to appear in the text document after the echo like above.
Simply create a new batch file on your desktop and place that in it and run it, so you can see how it works, any more qs, just ask.
-
Nov 12th, 2003, 09:27 AM
#5
ahh, I was trying to think of a 1 file way to do it. Glad someone knew.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|