Search found 1567 matches
- 23 Nov 2018 08:39
- Forum: DOS Batch Forum
- Topic: How to cut some blocks off the entire file then save into separated file
- Replies: 23
- Views: 19193
Re: How to cut off some blocks off the entire file then save into separated file
Thanks! ED! tried and got 2> was unexpected at this time. It was part of code for /F %%? in ( '^( find /V /C"" ^< "!$fileIn!" ^) 2>nul' ) do set "$NumberOfLines=%%?" When I took it off, it works but have some extra lines before the String my mistake, 2>nul should be 2^>nul because it's in a for. Yo...
- 22 Nov 2018 16:42
- Forum: DOS Batch Forum
- Topic: How to cut some blocks off the entire file then save into separated file
- Replies: 23
- Views: 19193
Re: How to cut off some blocks off the entire file then save into separated file
@echo off &setlocal enableDelayedExpansion set "$fileIn=Load_all.M83" set "$fileOu=Load_NAR.M83" > "!$fileOu!" type nul for /F %%? in ( '^( find /V /C"" ^< "!$fileIn!" ^) 2>nul' ) do set "$NumberOfLines=%%?" < "!$fileIn!" ( set /A $at = 0 &for /L %%i in ( 1, 1, !$NumberOfLines! ) do ( set "$=" &set...
- 21 Nov 2018 22:21
- Forum: DOS Batch Forum
- Topic: Wildcard during directory lookup produces unexpected results
- Replies: 7
- Views: 8067
Re: Wildcard during directory lookup produces unexpected results
@echo off for /F skip^=4^ delims^=^ eol^= %%? in ('dir /X /A-D "*a.CMD"') do ( echo.%%? set "$=%%?" setlocal enableDelayedExpansion set "$=!$:*a.CMD=!" if not defined $ ( echo. longName hit on: '%%?' ) endlocal ) pause exit /b What disturbs me the most about the above solution is the skip command, ...
- 21 Nov 2018 20:57
- Forum: DOS Batch Forum
- Topic: Wildcard during directory lookup produces unexpected results
- Replies: 7
- Views: 8067
Re: Wildcard during directory lookup produces unexpected results
Are you sure it's not the "short name"-issue - what does "dir/x" say? dir/X/S/A-D "*a.CMD" penpen I create a folder named "test". inside i create 2 control files "a.cmd" and "ba.CMD" and some false positives not just any name, only some names pop up for some reason so in my case "getFullPathFile_.c...
- 21 Nov 2018 17:09
- Forum: DOS Batch Forum
- Topic: How to cut some blocks off the entire file then save into separated file
- Replies: 23
- Views: 19193
Re: How to cut off some blocks off the entire file then save into separated file
cutoff where ? at a specified byte position or based upon the occurrence of a string ?
- 21 Nov 2018 10:49
- Forum: DOS Batch Forum
- Topic: Wildcard during directory lookup produces unexpected results
- Replies: 7
- Views: 8067
Re: Wildcard during directory lookup produces unexpected results
Hi Ed, Is it a for /r bug? I remember reading somewhere that for /r can generate erroneous output under certain conditions. As usual, I can’t remember where I read it, sorry. :( Maybe someone with a better memory (and a more organised bookmarks collection) can help you out. ;) Good luck! - SB The '...
- 21 Nov 2018 09:53
- Forum: DOS Batch Forum
- Topic: doskitXPserver2003
- Replies: 2
- Views: 5625
Re: doskit XP/server2003 TEASER
Hi Ed, Doskit sounds amazing! 8) I’d love to try it out, but I’m running Windows 7. :( What difficulty does Doskit have with Windows 7? - SB From what I've read there is a minor difference with the 'set' command. In 7 'set/P=' without double quotes will eat spaces at the beginning of the line, this...
- 21 Nov 2018 08:27
- Forum: DOS Batch Forum
- Topic: How to check write a file text completed to execute another task using batch script
- Replies: 4
- Views: 4256
Re: How to check write a file text completed to execute another task using batch script
"command ? Because that doesn't happen, a write either fails or succeeds. During writes the script waits for the command to complete." - Yes, I want after replace value in to file variable.txt and write it complete then execute a cron job using schtask Can say is I want to execute a cron job via va...
- 21 Nov 2018 08:08
- Forum: DOS Batch Forum
- Topic: Problems with variables ...
- Replies: 4
- Views: 4087
Re: Problems with variables ...
If csvchoice is only present once in your INI file then there is no need for the GOTO command. And if unique identifiers are used then you can just <:unique_id <nul rem^ &for %%? in ( condition ) do if %%?==condition goto :unique_id echo.previous loop aborted. :End.Csvchoice.Ini, these are typicall...
- 21 Nov 2018 07:56
- Forum: DOS Batch Forum
- Topic: How to check write a file text completed to execute another task using batch script
- Replies: 4
- Views: 4256
Re: How to check write a file text completed to execute another task using batch script
This is a bit odd to me echo(!new_file!) > !FILE_VARIABLE_OUT! rem ( (call ) >>!FILE_VARIABLE_OUT! ) 2>nul && ( rem Execute task when check file write completed rem echo The file write completed rem ) || ( rem echo The file is still being created rem ) Do you expect CMD to continue with the next com...
- 12 Nov 2018 09:11
- Forum: DOS Batch Forum
- Topic: Wildcard during directory lookup produces unexpected results
- Replies: 7
- Views: 8067
Wildcard during directory lookup produces unexpected results
I have several files in my folder namely a.cmd b.cmd ab.cmd getFullPathFile_.cmd getFullPbathFile_.CMD Now trying to find anything like *a.cmd @echo off echo. for /R %%? in ("*a.CMD") do echo(%%? echo. dir/B/S/A-D "*a.CMD" echo. for %%? in ("*a.CMD") do echo(%%? pause exit /b expecting return a.cmd ...
- 10 Nov 2018 18:59
- Forum: DOS Batch Forum
- Topic: doskitXPserver2003
- Replies: 2
- Views: 5625
doskitXPserver2003
@echo off &cls &title %~n0 :: -------------------------------------------------------------------------------------------------------------------------- :: tooComplex's doskitXPserver2003 v0.1 (20190129) ( :: :: supported platforms: winXP/server2003 - 32bit - x86 :: supported language: dutch, englis...
- 25 Sep 2018 08:18
- Forum: DOS Batch Forum
- Topic: copy partition script
- Replies: 3
- Views: 4729
Re: copy partition script
I describe some of the programs i studied to help people who are interested in advanced partitioning features beyond what is possible with diskpart. I am using server editions but they should also run on other editions of the Microsoft platform. This edition has a CLI but it cannot do things like co...
- 25 Sep 2018 08:00
- Forum: DOS Batch Forum
- Topic: FOR loop does not increment /L %%parameter
- Replies: 16
- Views: 22816
Re: FOR loop does not increment /L %%parameter
Thanks ger, you make finding the information that i need look easy
- 24 Sep 2018 19:00
- Forum: DOS Batch Forum
- Topic: FOR loop does not increment /L %%parameter
- Replies: 16
- Views: 22816
Re: FOR loop does not increment /L %%parameter
For a second i did though about writting everything in Java instead, as batch has no short concise guidelines on precisely understanding how to write code without getting into troubles. Java is really not designed for system programming, you will need additional libraries and it is one of the most ...