
Search found 5 matches
- 09 Aug 2013 11:48
- Forum: DOS Batch Forum
- Topic: For loop gets line from file but can't re-assign it.
- Replies: 7
- Views: 3200
Re: For loop gets line from file but can't re-assign it.
aha, thanks, Squahman!!! I will give this a try. I see what you mean from the code better now. I like DOS batchfiles, just sometimes very hard to get something that seems so obvious. 

- 08 Aug 2013 18:18
- Forum: DOS Batch Forum
- Topic: For loop gets line from file but can't re-assign it.
- Replies: 7
- Views: 3200
Re: For loop gets line from file but can't re-assign it.
thnx, i played with this and finally got one that works, maybe not best one...but it gets the commandline from the file, runs a start to open a window using the name contained within the commandline. @echo off setlocal EnableDelayedExpansion for /f "tokens=* delims= " %%i in (output.txt) D...
- 08 Aug 2013 16:15
- Forum: DOS Batch Forum
- Topic: For loop gets line from file but can't re-assign it.
- Replies: 7
- Views: 3200
Re: For loop gets line from file but can't re-assign it.
getting closer... This returns the machine name, but only for the last line in the file. I have heard of this happening, not sure how code goes to fix it... @echo off for /F "delims=" %%i in (output.txt) DO ( setlocal EnableDelayedExpansion set name=%%i rem get last 34 chars set name1=%nam...
- 08 Aug 2013 16:00
- Forum: DOS Batch Forum
- Topic: For loop gets line from file but can't re-assign it.
- Replies: 7
- Views: 3200
Re: For loop gets line from file but can't re-assign it.
parens are there, and I created a new file, in which the variable does work...not sure why...but ok.
So enableDelayedExpansion and use Excl. pts,
tnx,
will try this and let you know..
bob
So enableDelayedExpansion and use Excl. pts,
tnx,
will try this and let you know..
bob
- 08 Aug 2013 13:34
- Forum: DOS Batch Forum
- Topic: For loop gets line from file but can't re-assign it.
- Replies: 7
- Views: 3200
For loop gets line from file but can't re-assign it.
This works: set name=kd -k kdsrv:server=@{tcp:port=5505,server=nebp2-nns0067,password=20254001},trans=@{com:pipe,port=\\. \pipe\c5402e0c-19e8-4026-af46-e00c1d3fa082-DDPRTMCOOWMX03,resets=0,reconnect} echo %name% (echoes correctly) rem get last 34 chars set name=%name:~-34% echo %name% (echoes DDPRTM...