Search found 4036 matches

by Squashman
29 Jan 2012 13:06
Forum: DOS Batch Forum
Topic: TASKKILL: how to skip unwanted task for better performance?
Replies: 1
Views: 1330

Re: TASKKILL: how to skip unwanted task for better performan

You may want to refrain from using double colons for comments inside an expression surrounded by parenthesis.
by Squashman
29 Jan 2012 08:15
Forum: DOS Batch Forum
Topic: bat file open up dir and send command line
Replies: 3
Views: 1794

Re: bat file open up dir and send command line

I always like people to post the code they tried to at least get a better understanding of what they are trying to do. If you need to change the working directory you could do that two ways. You can use the CD or PUSHD command. CD /D "C:\Path to Folder" or PUSHD "C:\Path to Folder&quo...
by Squashman
26 Jan 2012 14:57
Forum: DOS Batch Forum
Topic: Determining the number of lines in a file.
Replies: 50
Views: 19970

Re: Determining the number of lines in a file.

Well here is some interesting output from this batch. E:\batch files\HEAD>FileAttrib.bat EST3_CRLF.txt FC: cannot open 25712336 - No such file or folder The system cannot find the batch label specified - error E:\batch files\HEAD>type FileAttrib.log Filename Quantity RecLength EOL 25712336 1026 0D0A...
by Squashman
24 Jan 2012 20:36
Forum: DOS Batch Forum
Topic: Force a process physically execute on a different server
Replies: 2
Views: 1366

Re: Force a process physically execute on a different server

The batch file needs to physically be executed on the server you want it to run. If you have admin access to the server you could use psexec to execute it on the correct server.
by Squashman
23 Jan 2012 06:56
Forum: DOS Batch Forum
Topic: issues with batch find and file backup to mapped drive
Replies: 4
Views: 2009

Re: issues with batch find and file backup to mapped drive

Why didn't you use a FOR /R like you posted in this thread. http://www.dostips.com/forum/viewtopic.php?f=3&t=2763&p=13020#p13020 Or you could put the DIR command into the FOR loop instead of writing the output to a text file. cd /d C:\ for /f "delims=" %%a in ('dir /a-d /s /b *.pst...
by Squashman
23 Jan 2012 06:48
Forum: DOS Batch Forum
Topic: issues with batch find and file backup to mapped drive
Replies: 4
Views: 2009

Re: issues with batch find and file backup to mapped drive

When changing the DRIVE and path you have to use the /D switch with the CD command.

I usually prefer to just use the PUSHD command instead.
by Squashman
22 Jan 2012 15:08
Forum: DOS Batch Forum
Topic: Undocumented FINDSTR features and limitations
Replies: 29
Views: 24439

Re: Undocumented FINDSTR features and limitations

aGerman wrote:I had to correct this line to get it to run:
for %%A in (O00 K02 Q00 F05 C00) do set "search=!search! /c:"!prefix!%%A""

Regards
aGerman

Yeah, I saw that as well when I initially ran the code. Didn't want to discredit Dave for a minor syntax error.
by Squashman
22 Jan 2012 14:29
Forum: DOS Batch Forum
Topic: Undocumented FINDSTR features and limitations
Replies: 29
Views: 24439

Re: Undocumented FINDSTR features and limitations

It's like winning the lottery every time I post a question here.
Thanks again Dave.
by Squashman
22 Jan 2012 13:57
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 59644

Re: foolproof counting of arguments

Don't think there is much you could do about a string not being closed quoted correctly. If you just have a set of empty quotes then you can check to see if it is empty. So given your example of "" a --- This code would correctly count it as 2. @echo off set count=0 for %%I in (%*) do IF N...
by Squashman
22 Jan 2012 13:34
Forum: DOS Batch Forum
Topic: Undocumented FINDSTR features and limitations
Replies: 29
Views: 24439

Re: Undocumented FINDSTR features and limitations

Couple of other questions. 1) Can't seem to put this into a FOR LOOP. I get the error FINDSTR: Bad command line FOR /F "tokens=2 delims= " %%A in ('findstr /r /c:"EA ..*!CR!*!LF!..*!CR!*!LF!..*!CR!*!LF!..*!CR!*!LF!GC O00" test.txt') do echo %%A 2)Dave said in his article that usi...
by Squashman
21 Jan 2012 16:31
Forum: DOS Batch Forum
Topic: Undocumented FINDSTR features and limitations
Replies: 29
Views: 24439

Re: Undocumented FINDSTR features and limitations

So can the search be extended across multiple lines? I am basically looking at the lines that start with EA and 4 lines down will be the line GC. ** YP 2001 RC U EA 9780702026171 RF R WE 1780 SG 1 GC O00 I3 1313101313134 PC S6.1T ** YP 2003 RC J EA 9780237526306 RF R WE 220 SG 4 GC C09 I3 1111232349...
by Squashman
20 Jan 2012 14:28
Forum: DOS Batch Forum
Topic: Piped input and output to a batch file
Replies: 18
Views: 10544

Re: Piped input and output to a batch file

I have of course gotten off the main topic of this thread which was piping to another command. But just throwing this last one out there. This code from Orange Batch on the same file took all of 16 seconds. @echo off echo %time%>oblog.log type nul>"OBtemp.txt" set "suffix1=%~n1 ."...
by Squashman
20 Jan 2012 14:07
Forum: DOS Batch Forum
Topic: Piped input and output to a batch file
Replies: 18
Views: 10544

Re: Piped input and output to a batch file

I must have typed CTRL+C thinking it was hanging. I reran it again and it did work but it took 9 minutes 20 seconds on a file with 6,947 lines in it. File is actually just under 7MB in size. So I ran it with Dave's Code. @echo off echo %TIME%>davelog.log setlocal set "suffix1=%~n1 ." set s...