Search found 237 matches

by DosItHelp
26 Sep 2006 21:57
Forum: DOS Batch Forum
Topic: Findstr with long strings
Replies: 1
Views: 11538

yonitda,

Indeed findstr shows a "FINDSTR: Search string too long." error when the search string is longer than 127 characters.
The find command doesn't have this limitation.

DOS IT HELP?

If not let me know there are other options :wink:
by DosItHelp
23 Sep 2006 20:34
Forum: DOS Batch Forum
Topic: any idea howto retrieve the GUID of network card in a script
Replies: 4
Views: 13950

Matice,

:idea: Your code is creating data in c:\nicguid.txt but then tries to read it from c:\source\nicguid.txt.

A regular expression parser surely is a powerful tool. However this web page tries to suggest portable solution that work on XP systems without extra downloads. :D
by DosItHelp
21 Sep 2006 21:58
Forum: DOS Batch Forum
Topic: any idea howto retrieve the GUID of network card in a script
Replies: 4
Views: 13950

Matice, Use the :NetworkDeviceName2Guid function in you main code like this: CALL:NetworkDeviceName2Guid "Local Area Connection" guid ECHO.The GUID is: %guid% GOTO:EOF Copy the :NetworkDeviceName2Guid function from here: http://www.dostips.com/DtCodeCmdLib.php#NetworkDeviceName2Guid to the...
by DosItHelp
21 Sep 2006 20:36
Forum: DOS Batch Forum
Topic: how to indent the outputs in dos batch file
Replies: 1
Views: 12281

It's easy when the source of the indended content is another file. I.e.: If names.txt containes names like: Daniel Ollie Sam Nina Victor Cris Then code like this ... echo.List of Names:>list.txt for /f "tokens=* delims=" %%a in (names.txt) do echo. %%a>>list.txt ... will create an ...
by DosItHelp
17 Sep 2006 19:55
Forum: DOS Batch Forum
Topic: How can I input a name in the same line in CMD Prompt
Replies: 1
Views: 9285

Try:

Code: Select all

set /p username=Your Name: 
echo.%username%>>usernames.txt

:wink:
by DosItHelp
13 Sep 2006 21:03
Forum: DOS Batch Forum
Topic: DIR listing order
Replies: 3
Views: 12376

Matice, Go to "Batch Files" "11 - Sorting text with numbers" and download the sortn.bat file. http://www.dostips.com/DtCodeBatchFiles.php#_Toc145951142 Then from a command line pipe the output of a dir command into sortn.bat like this: dir /b|sortn Make sure sortn.bat is accessible if not use the fu...
by DosItHelp
13 Sep 2006 18:05
Forum: DOS Batch Forum
Topic: Pulling Windows2003 log files
Replies: 3
Views: 13290

Sorry I didn't try it out: It had two errors: 1. to extract CC from YYYY use: %YYYY: ~ -2% 2. to make sure MM and DD are always two digits, e.g. with leading zero, use: set MM=00%MM%&set DD=00%DD% set DD=%DD:~-2%&set MM=%MM:~-2% You will also need to ensure the script stops before running in...
by DosItHelp
12 Sep 2006 19:10
Forum: DOS Batch Forum
Topic: Pulling Windows2003 log files
Replies: 3
Views: 13290

Cooldmitriy Copy the functions :jdate , :date2jdate , and :jdate2date to the end of your batch script. http://www.dostips.com/DtCodeCmdLib.php#jdate http://www.dostips.com/DtCodeCmdLib.php#date2jdate http://www.dostips.com/DtCodeCmdLib.php#jdate2date Then you can calculate the date like this: call:j...
by DosItHelp
15 Jul 2006 20:47
Forum: DOS Batch Forum
Topic: double expansion of variables
Replies: 2
Views: 12166

dizze, Yes you can, in your case use: call echo.%%c%cols%%% Before executing the line the command interpreter will resolve: %cols% --> value of cols variable %% ------> % Assuming the value of the cols variable is 0 and the value of c0 is 12345 this means: call echo.%%c%cols%%% will be resolved to: ...
by DosItHelp
07 Jun 2006 19:29
Forum: DOS Batch Forum
Topic: trying to delete files in one directory older than today
Replies: 2
Views: 11863

Try this: cd "\yourdirectory\here" for %%a in (*.txt) do echo.%%~ta|findstr /v /b /c:"%date:~4%">NUL&&del "%%a" The FOR loop - finds all txt files in the directory. echo.%%~ta - resolves into file date and file time which will be piped into findstr. %dat...
by DosItHelp
10 May 2006 21:56
Forum: DOS Batch Forum
Topic: Moving files based on creation date of parent file
Replies: 3
Views: 7633

CameronY Very Interesting ... Add the following function at the end of your batch: GOTO:EOF :CmpFTime op file1 file2 attr1 attr2 -- compares the time of two files :: -- op [in] - compare operator, see 'IF /?', i.e.EQU, NEQ, LSS, LEQ, GTR, GEQ :: -- fileL [in] - file name, left side of compare :: -- ...
by DosItHelp
18 Feb 2006 20:22
Forum: DOS Batch Forum
Topic: How to act on the difference of two files?
Replies: 3
Views: 7810

In WinXP fc does return an exit code and you could use: fc "%file1%" "%file2%">NUL&&( echo the files are equal rem keep this rem as last command in the block )||( echo the files are different ) However if the fc command in your windows version works differ...