Search found 4150 matches

by Squashman
24 Feb 2012 08:30
Forum: DOS Batch Forum
Topic: problems with FINDSTR in multiline search
Replies: 4
Views: 3458

Re: problems with FINDSTR in multiline search

Your search parameter also has another fundamental flaw.
You are searching for any amount of numbers, then a LF and then a semi colon but your example is number semicolon and then there would be a LF if your file is unix based.
by Squashman
23 Feb 2012 16:00
Forum: DOS Batch Forum
Topic: Wait until application finished
Replies: 16
Views: 11702

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?
by Squashman
23 Feb 2012 06:22
Forum: DOS Batch Forum
Topic: school assignment, any help asap is very appreciated
Replies: 8
Views: 4363

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
by Squashman
22 Feb 2012 20:04
Forum: DOS Batch Forum
Topic: school assignment, any help asap is very appreciated
Replies: 8
Views: 4363

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.
by Squashman
22 Feb 2012 10:26
Forum: DOS Batch Forum
Topic: Performance issues variable VS file
Replies: 9
Views: 7555

Re: Performance issues variable VS file

dbenham wrote:This is a major bummer :cry:

I agree. I was hoping for a better outcome as well.
by Squashman
22 Feb 2012 06:21
Forum: DOS Batch Forum
Topic: Performance issues variable VS file
Replies: 9
Views: 7555

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...
by Squashman
21 Feb 2012 15:29
Forum: DOS Batch Forum
Topic: Performance issues variable VS file
Replies: 9
Views: 7555

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.
by Squashman
21 Feb 2012 10:36
Forum: DOS Batch Forum
Topic: Monitoring system service
Replies: 3
Views: 3203

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
by Squashman
20 Feb 2012 12:38
Forum: DOS Batch Forum
Topic: Echo subtotal counter within a for loop
Replies: 2
Views: 2418

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.
by Squashman
19 Feb 2012 18:55
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 72618

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...
by Squashman
19 Feb 2012 12:59
Forum: DOS Batch Forum
Topic: comparison with delayed variable
Replies: 19
Views: 8072

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 ....
by Squashman
19 Feb 2012 12:15
Forum: DOS Batch Forum
Topic: comparison with delayed variable
Replies: 19
Views: 8072

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.
by Squashman
19 Feb 2012 12:10
Forum: DOS Batch Forum
Topic: comparison with delayed variable
Replies: 19
Views: 8072

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...
by Squashman
19 Feb 2012 11:57
Forum: DOS Batch Forum
Topic: comparison with delayed variable
Replies: 19
Views: 8072

Re: comparison with delayed variable

Use a GOTO. But that will break both loops. Need to call the 2nd loop from the first
by Squashman
19 Feb 2012 11:03
Forum: DOS Batch Forum
Topic: comparison with delayed variable
Replies: 19
Views: 8072

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?