Search found 5 matches
- 01 Mar 2010 03:51
- Forum: DOS Batch Forum
- Topic: How can I make SET to set a variable based on txt content?
- Replies: 3
- Views: 5817
Re: How can I make SET to set a variable based on txt content?
OK I have found this solution that works in plain old DOS: @echo off echo @echo off> director.bat echo set getdir_=%%2>> director.bat echo echo %%getdir_%%>> director.bat dir | find "Directory"> go.bat call go if exist director.bat del director.bat if exist go.bat del go.bat getdir_ is the...
- 28 Feb 2010 17:06
- Forum: DOS Batch Forum
- Topic: How can I make SET to set a variable based on txt content?
- Replies: 3
- Views: 5817
Re: How can I make SET to set a variable based on txt content?
I did it and the result was this variable:
/P "test1="
I guess plain dos from win98se does not get this command...
/P "test1="
I guess plain dos from win98se does not get this command...
- 28 Feb 2010 17:04
- Forum: DOS Batch Forum
- Topic: How to make a BAT to edit a string inside a test file?
- Replies: 3
- Views: 6264
Re: How to make a BAT to edit a string inside a test file?
thanks but it did not work... I should have pointed that I am using a DOS-only enviroment from win98se.... I get a "Syntax error" after: for /f "delims=: tokens=1*" %%a in ('findstr /n /r /c:"^" "%file%"') do set "line=%%b" &call :process and the...
- 28 Feb 2010 13:13
- Forum: DOS Batch Forum
- Topic: How can I make SET to set a variable based on txt content?
- Replies: 3
- Views: 5817
How can I make SET to set a variable based on txt content?
Hiya!
is there a way to make SET create a variable from a small txt ?
let's say I have 1.txt that has inside: 123
and I want to make a variable, let's say: TEST1
so is there a way to make a batch file to SET TEST1=1.txt_content
so I get TEST1=123
??
is there a way to make SET create a variable from a small txt ?
let's say I have 1.txt that has inside: 123
and I want to make a variable, let's say: TEST1
so is there a way to make a batch file to SET TEST1=1.txt_content
so I get TEST1=123
??
- 27 Feb 2010 18:41
- Forum: DOS Batch Forum
- Topic: How to make a BAT to edit a string inside a test file?
- Replies: 3
- Views: 6264
How to make a BAT to edit a string inside a test file?
Hiya! Let me explain what I want to do... I am trying to make a DOS-only batch file that will edit a variable in a text file , the variable depends on the location of the .bat file... so for example if I have: c:\test\ varedit.bat it would open a file , look for a predefined string like %EDITME% and...