Search found 244 matches
- 03 Jul 2016 05:52
- Forum: DOS Batch Forum
- Topic: Why renames/creates the simple for loop files multiple times?
- Replies: 3
- Views: 5506
Re: Why renames/creates the simple for loop files multiple times?
Thanks, I assume, you are right. This is probably an issue of the FAT system compatibility, namely the file entries and the for loop pointer to this entries. The for loop not always creates an additional file and sometimes it creates three or more files. It depends on whether the new file entry is a...
- 02 Jul 2016 22:56
- Forum: DOS Batch Forum
- Topic: Why renames/creates the simple for loop files multiple times?
- Replies: 3
- Views: 5506
Why renames/creates the simple for loop files multiple times?
The issue is described in this stackoverflow answer by debenham: The simple FOR command with wildcards begins iterating files before it finishes reading the entire directory. It buffers a block of files and iterates them, then picks up where it left off. When you rename a file, the renamed file may ...
- 24 May 2015 20:03
- Forum: DOS Batch Forum
- Topic: getting camera info from bath file?
- Replies: 6
- Views: 8372
Re: getting camera info from bath file?
Compo wrote:Here's all I'm willing to provide: (this isn't a powershell group)
So please do not provide Powershell code here, except in hybrid cmd shell command files.
Thank you
- 07 Oct 2014 12:13
- Forum: DOS Batch Forum
- Topic: For \F not working --- Revert immediately please
- Replies: 7
- Views: 8213
Re: For \F not working --- Revert immediately please
ShadowThief wrote:when you press SHIFT and the ' button that is next to enter.
It depends on your local keybord. It appears here when I press SHIFT and 2
- 23 May 2014 19:06
- Forum: DOS Batch Forum
- Topic: Dir Listing based on filetype and filename iteration
- Replies: 6
- Views: 7731
Re: Dir Listing based on filetype and filename iteration
Give it a try: @ECHO OFF &SETLOCAL disableDelayedExpansion FOR %%a IN (test\Recording*_*.mov) DO ( FOR /f "delims=_" %%b IN ("%%~a") DO SET /a mov.%%~b+=1 ) FOR /f "tokens=1*delims==" %%a IN ('SET mov.') DO IF NOT %%b==1 ( FOR /f "tokens=1*delims=." %%c IN...
- 14 Feb 2014 06:02
- Forum: DOS Batch Forum
- Topic: curiosity about echo command in prompt
- Replies: 2
- Views: 4306
Re: curiosity about echo command in prompt
to avoid this put EOF at the end of file:
Code: Select all
C:\TEST>xxd -g1 test.cmd
0000000: 40 45 43 48 4f 20 4f 46 46 0d 0a 45 43 48 4f 20 @ECHO OFF..ECHO
0000010: 68 0d 0a 1a h...
C:\TEST>test
h
C:\TEST>
- 11 Feb 2014 00:01
- Forum: DOS Batch Forum
- Topic: Trouble with errorlevels
- Replies: 8
- Views: 10521
Re: Trouble with errorlevels
untested @ECHO OFF &SETLOCAL disableDelayedExpansion rem Declare Variables SET "Java_Sec_Scope=" SET /P "Java_Sec_Scope=Would you like to set the java security level (G)lobally or for (C)urrent User? " IF /i "%Java_Sec_Scope%"=="C" GOTO Local IF /i "%...
- 10 Feb 2014 16:18
- Forum: DOS Batch Forum
- Topic: Trouble with errorlevels
- Replies: 8
- Views: 10521
Re: Trouble with errorlevels
inside a code block you need delayed expansion to access !errorlevel! (not %errorlevel%)
- 10 Feb 2014 16:07
- Forum: DOS Batch Forum
- Topic: Trouble with errorlevels
- Replies: 8
- Views: 10521
Re: Trouble with errorlevels
there is one closing parenthesis missing in your batch.
- 02 Feb 2014 03:43
- Forum: DOS Batch Forum
- Topic: I need help copying only certain bytes to a new file.
- Replies: 4
- Views: 5792
Re: I need help copying only certain bytes to a new file.
You can use a patch tool for binaries, ex. http://stackoverflow.com/questions/1945 ... ry-patches
- 31 Jan 2014 10:54
- Forum: DOS Batch Forum
- Topic: Win7 FOR fails to parse correctly if 0Ah in parsed DSN
- Replies: 3
- Views: 5811
Re: Win7 FOR fails to parse correctly if 0Ah in parsed DSN
try this: for %%a in (COUNTER.txt) do fsutil file createnew COUNTER.tmp %%~za fc COUNTER.txt COUNTER.tmp /b | findstr /c:"00000016: 0A" /c:"00000017: 0A" >nul&& echo 0ah found || echo 0ah not found del COUNTER.tmp Please note, this is an example. The parameter's values ma...
- 26 Jan 2014 16:36
- Forum: DOS Batch Forum
- Topic: Creating carriage return (CR, 0Dh) doesn't work in Windows 8
- Replies: 6
- Views: 8405
Creating carriage return (CR, 0Dh) does work in Windows 8
Thank you, this is working:
Problem is solved
Code: Select all
@echo off &setlocal disableDelayedExpansion
for /f %%a in ('copy /Z "%~dpf0" nul') do set "CR=%%a"
setlocal enableDelayedExpansion
for /l %%a in (1,1,10) do (
<nul set /p "=%%a!CR!"
)
Problem is solved
- 26 Jan 2014 15:12
- Forum: DOS Batch Forum
- Topic: Creating carriage return (CR, 0Dh) doesn't work in Windows 8
- Replies: 6
- Views: 8405
Creating carriage return (CR, 0Dh) doesn't work in Windows 8
I tested the following code in XP Home x86 and Windows 8 Pro x64: @echo off &setlocal disableDelayedExpansion for /f %%a in ('copy /Z "%~dpf0" nul') do set "CR=%%a" setlocal enableDelayedExpansion for /l %%a in (1,1,10) do ( <nul set /p "=!CR!%%a" ) Output in XP is:...
- 24 Jan 2014 12:54
- Forum: DOS Batch Forum
- Topic: Remove Time Element From File Creation Date
- Replies: 5
- Views: 6806
Re: Remove Time Element From File Creation Date
I do not know where to place the snippet that you posted. Always and only on the right place: @ECHO OFF &SETLOCAL (FOR /f "delims=" %%a IN ('dir /b /a-d /s /n "C:\Documents and Settings\All Users\Documents\My Pictures\Pics & Vids"') DO ( FOR /f "tokens=1-3*" %%...
- 24 Jan 2014 01:46
- Forum: DOS Batch Forum
- Topic: How to handle a comma in a filename with WMIC?
- Replies: 32
- Views: 37908
Re: How to handle a comma in a filename with WMIC?
Btw. %~sI and %~fsI give the same result, but M$ doesn't know it: The modifiers can be combined to get compound results: %~dpI - expands %I to a drive letter and path only %~nxI - expands %I to a file name and extension only %~fsI - expands %I to a full path name with short names only %~dp$PATH:I - ...