Search found 4314 matches
- 23 Feb 2012 16:00
- Forum: DOS Batch Forum
- Topic: Wait until application finished
- Replies: 16
- Views: 18725
Re: Wait until application finished
You may be caught in a catch22. Some programs do not play nice with the /wait switch either. But either way how would we know the program is finished if it is not closing itself?
- 23 Feb 2012 06:22
- Forum: DOS Batch Forum
- Topic: school assignment, any help asap is very appreciated
- Replies: 8
- Views: 8065
Re: school assignment, any help asap is very appreciated
foxidrive wrote:@echo off
for %%a in (a b c d e f g h i j k l m n o p q r s t) do net user "%%~a" /add
- 22 Feb 2012 20:04
- Forum: DOS Batch Forum
- Topic: school assignment, any help asap is very appreciated
- Replies: 8
- Views: 8065
Re: school assignment, any help asap is very appreciated
Well I don't think posting twice will help you any quicker. What does your teacher get paid to do?
Open up a command prompt and type: for /?
You can do the same thing with the net command to see the syntax. Can probably do the same with Google.
Open up a command prompt and type: for /?
You can do the same thing with the net command to see the syntax. Can probably do the same with Google.
- 22 Feb 2012 10:26
- Forum: DOS Batch Forum
- Topic: Performance issues variable VS file
- Replies: 9
- Views: 11351
Re: Performance issues variable VS file
dbenham wrote:This is a major bummer
I agree. I was hoping for a better outcome as well.
- 22 Feb 2012 06:21
- Forum: DOS Batch Forum
- Topic: Performance issues variable VS file
- Replies: 9
- Views: 11351
Re: Performance issues variable VS file
found out today that more +n will stop at 65534 lines and will then output -- more -- to your output file. Confirmed on XP Pro SP3 Bingo. I was helping another user on another forum and someone suggested that they use: more +5 input.txt>output.txt to skip the first 5 lines of a file and output to a...
- 21 Feb 2012 15:29
- Forum: DOS Batch Forum
- Topic: Performance issues variable VS file
- Replies: 9
- Views: 11351
Re: Performance issues variable VS file
P n is an extended feature and as far as I know it is an interactive command. Not sure if you can use it in a script.
I actually found out today that more +n will stop at 65534 lines and will then output -- more -- to your output file. But I would assume you don't deal with large files like I do.
I actually found out today that more +n will stop at 65534 lines and will then output -- more -- to your output file. But I would assume you don't deal with large files like I do.
- 21 Feb 2012 10:36
- Forum: DOS Batch Forum
- Topic: Monitoring system service
- Replies: 3
- Views: 4793
Re: Monitoring system service
You could just use a for loop to set the current state of the process to a variable.
Code: Select all
for /f "tokens=3 delims=: " %%G in ('sc query spooler ^| find "STATE"') do set state=%%G
- 20 Feb 2012 12:38
- Forum: DOS Batch Forum
- Topic: Echo subtotal counter within a for loop
- Replies: 2
- Views: 3367
Re: Echo subtotal counter within a for loop
You need to enable delayed expansion and then use exclamations around your variable name instead of the percent signs.
- 19 Feb 2012 18:55
- Forum: DOS Batch Forum
- Topic: foolproof counting of arguments
- Replies: 56
- Views: 103791
Re: foolproof counting of arguments
While experimenting I learned that CLS sends a form feed character <FF> (0x0C) to the screen. If you redirect CLS to con, then you get a graphical representation of the <FF> character on the screen. I can use CLS behavior to get <FF> in a variable: @echo off setlocal for /f %%A in ('cls') do set FF...
- 19 Feb 2012 12:59
- Forum: DOS Batch Forum
- Topic: comparison with delayed variable
- Replies: 19
- Views: 13254
Re: comparison with delayed variable
Why not make your 2nd for loop use the tempstr in the dir listing instead?
Code: Select all
for /f "delims=" %%H in ('dir /a-d /b "GEN !sPDFname! *.html') do ....
- 19 Feb 2012 12:15
- Forum: DOS Batch Forum
- Topic: comparison with delayed variable
- Replies: 19
- Views: 13254
Re: comparison with delayed variable
aGerman wrote:You can't use wildcards in an if condition.
I can't remember but I thought IF EXIST works with wildcard. Don't have computer access today so I can't test. Just on my phone.
- 19 Feb 2012 12:10
- Forum: DOS Batch Forum
- Topic: comparison with delayed variable
- Replies: 19
- Views: 13254
Re: comparison with delayed variable
You realize all those set statements are unnecessary. You could change your DIR command in your first for loop to only display PdF files that begin with a number by listing each ('dir /a-d /b 0*.pdf 1*.pdf etc...) or piping your existing dir command to the findstr command and define a regular expres...
- 19 Feb 2012 11:57
- Forum: DOS Batch Forum
- Topic: comparison with delayed variable
- Replies: 19
- Views: 13254
Re: comparison with delayed variable
Use a GOTO. But that will break both loops. Need to call the 2nd loop from the first
- 19 Feb 2012 11:03
- Forum: DOS Batch Forum
- Topic: comparison with delayed variable
- Replies: 19
- Views: 13254
Re: comparison with delayed variable
So all you really want to do is compare the first 5 characters of each string?
Sure would like to see your entire code. It really helps people understand what the intended goal of the batch file is. Are you attempting to see if a file exists?
Sure would like to see your entire code. It really helps people understand what the intended goal of the batch file is. Are you attempting to see if a file exists?
- 18 Feb 2012 14:58
- Forum: DOS Batch Forum
- Topic: Copy files one at a time w/time interval
- Replies: 3
- Views: 4221
Re: Copy files one at a time w/time interval
Which version of windows are you running?