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.
Search found 4309 matches
- 21 Feb 2012 15:29
- Forum: DOS Batch Forum
- Topic: Performance issues variable VS file
- Replies: 9
- Views: 11242
- 21 Feb 2012 10:36
- Forum: DOS Batch Forum
- Topic: Monitoring system service
- Replies: 3
- Views: 4749
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: 3349
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: 102847
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: 13152
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: 13152
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: 13152
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: 13152
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: 13152
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: 4195
Re: Copy files one at a time w/time interval
Which version of windows are you running?
- 18 Feb 2012 08:11
- Forum: DOS Batch Forum
- Topic: how to rename files
- Replies: 18
- Views: 14115
Re: how to rename files
I can get it down to this.
Google Search: </title><style><!--
Can't seem to get everything after the closing title metatag to go away.
Google Search: </title><style><!--
Can't seem to get everything after the closing title metatag to go away.
- 18 Feb 2012 07:35
- Forum: DOS Batch Forum
- Topic: how to rename files
- Replies: 18
- Views: 14115
Re: how to rename files
I see your point.
So not only do you have to take into consideration the evil characters batch doesn't like we also have to take into consideration that the TITLE metatag is not on a line by itself.
So not only do you have to take into consideration the evil characters batch doesn't like we also have to take into consideration that the TITLE metatag is not on a line by itself.
- 18 Feb 2012 07:11
- Forum: DOS Batch Forum
- Topic: how to rename files
- Replies: 18
- Views: 14115
Re: how to rename files
Just down and dirty without taking into consideration of any poison characters. Given this as your input which is actually the first couple lines of source of this webpage. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitio...
- 17 Feb 2012 07:33
- Forum: DOS Batch Forum
- Topic: rename a folder
- Replies: 6
- Views: 6372
Re: rename a folder
Does only one folder exist in the directory? Or should the batch file keep track of the name of the folder? I was kind of thinking the same thing. But regardless of that it seems like you would need extra logic for the first time the script runs just so that is Changes the X at the end of the folde...
- 17 Feb 2012 07:24
- Forum: DOS Batch Forum
- Topic: using echo to enter text in a file and carriage return
- Replies: 21
- Views: 25293
Re: using echo to enter text in a file and carriage return
chr15b wrote:Squashman wrote:What would this have to do with Outlook when you were using Bmail and Blat?
blat/bmail send the file via smtp as the body of an email. Outlook is where i am reading it.
yes I realize what Bmail and Blat do. You just made it sound like your script issue was an issue with Outlook.