Search found 40 matches
- 04 Dec 2019 20:00
- Forum: DOS Batch Forum
- Topic: My program isn't working as it should.
- Replies: 2
- Views: 101
Re: My program isn't working as it should.
It looks like you created (actually: not finished) a very complex way (replacing text from a certain position to see if the "," is still there and then shifting a position to repeat the process until you find what the number between the "," and the ":" is) to get this result: output[1]_x=0 output[1]...
- 24 Nov 2019 07:43
- Forum: DOS Batch Forum
- Topic: single line in runonce
- Replies: 4
- Views: 252
Re: single line in runonce
If you want to expand a variable to its value in the same command line you have to enable delayed variable expansion [...] Or: @for %%i in (A:,B:,D:,E:,F:,G:,H:,I:,J:,K:,L:,M:,N:,O:,P:,Q:,R:,S:,T:,U:,V:,W:,X:,Y:,Z:,) do @if exist "%%i\autounattend.xml" (set "usb=%%i" & call echo the usb drive is "%...
- 21 Nov 2019 15:36
- Forum: DOS Batch Forum
- Topic: Old Script on (relatively) new computer
- Replies: 11
- Views: 376
Re: Old Script on (relatively) new computer
replace for /F "tokens=*" %%B in ('dir /B/A-D/ONE "%%~nA.0*"') do ( set PG=!PG! %%~nxB ) with: for /F "tokens=*" %%B in ('dir /B/A-D/ONE "%%~nA.*"') do ( set PG=!PG! %%~nxB ) ( "%%~nA.0*" replaced with "%%~nA.*" to enable up to 999 pages) or even: for /F "tokens=*" %%B in ('dir /B/A-D/OE "%%~nA.*"')...
- 21 Nov 2019 12:29
- Forum: DOS Batch Forum
- Topic: Old Script on (relatively) new computer
- Replies: 11
- Views: 376
Re: Old Script on (relatively) new computer
I have edited the script I posted to show where I think the closing parenthesis of the second for-loop should be placed:
for /F "tokens=*" %%B in ('dir /B/A-D/ONE "%%~nA.0*"') do (
set PG=!PG! %%~nxB
)
for /F "tokens=*" %%B in ('dir /B/A-D/ONE "%%~nA.0*"') do (
set PG=!PG! %%~nxB
)
- 20 Nov 2019 17:26
- Forum: DOS Batch Forum
- Topic: Old Script on (relatively) new computer
- Replies: 11
- Views: 376
Re: Old Script on (relatively) new computer
1. You missed the "(" and ")" again in your a.bat 2. You need quotes around %DST%%%~nA.PDF and similar : "%DST%%%~nA.PDF", not around set SRC="c:\test\src\" and set DST="C:\test\dest\" replace @echo off (first line of script) with @echo on to follow in detail at which step of the script the error co...
- 20 Nov 2019 15:54
- Forum: DOS Batch Forum
- Topic: Start Application At A Specific Transaction With Batch File
- Replies: 2
- Views: 244
Re: Start Application At A Specific Transaction With Batch File
Read the documentation of your EVO application and search for command line options.
If it is possible to provide credentials this way, there you can find it.
If it is possible to provide credentials this way, there you can find it.
- 20 Nov 2019 15:45
- Forum: DOS Batch Forum
- Topic: Old Script on (relatively) new computer
- Replies: 11
- Views: 376
Re: Old Script on (relatively) new computer
What am I missing? It looks like a couple of () for the second FOR command (and " " around filenames in case the include spaces or special characters. Try it by: start CMD.exe CD /d c:\test\src Execute your script That way the CMD window will show you any possible erroirs. New code: @echo off & set...
- 27 Oct 2019 02:24
- Forum: DOS Batch Forum
- Topic: Eliminating multiple empty lines
- Replies: 4
- Views: 3596
Re: Eliminating multiple empty lines
Unless at the beginning of the file :wink: You are right! Never occurred to me that a text file could start with empty lines :o In case it does (does it ever?): $INFILES = "T:\*.txt" $OUTFOLDER = "T:\test" gi $INFILES | % { ( gc -Raw $_ ) -creplace("^(`r`n){3,}","`$1`$1") -creplace("(`r`n){4,}","`r...
- 26 Oct 2019 15:57
- Forum: DOS Batch Forum
- Topic: Find not working
- Replies: 2
- Views: 2881
Re: Find not working
For more details: https://ss64.com/nt/syntax-conditional.html
- 26 Oct 2019 15:45
- Forum: DOS Batch Forum
- Topic: Eliminating multiple empty lines
- Replies: 4
- Views: 3596
Re: Eliminating multiple empty lines
I have a 1000 text files and would like to replace three (or more) empty lines with two empty lines. How could I do this? That is, I'd like to replace three (or more) new line characters with two new line characters. 3 empty lines would require 4 "new line characters" .. BTW (and off-topic): I woul...
- 24 Oct 2019 15:41
- Forum: DOS Batch Forum
- Topic: CAD start based on license Bundle check
- Replies: 3
- Views: 3981
Re: CAD start based on license Bundle check
Good luck!
(and let us know the results ..)
(and let us know the results ..)
- 17 Oct 2019 15:18
- Forum: DOS Batch Forum
- Topic: Insert new line at certain line works but the lines starting with ; all gone, why?
- Replies: 3
- Views: 4143
- 17 Oct 2019 14:13
- Forum: DOS Batch Forum
- Topic: Insert new line at certain line works but the lines starting with ; all gone, why?
- Replies: 3
- Views: 4143
Re: Insert new line at certain line works but the lines starting with ; all gone, why?
";" is the default EOL character in FOR commands.
Use a dummy character that is not in the lines you want to parse (like "@") : eol=@
See FOR /? for details.
Use a dummy character that is not in the lines you want to parse (like "@") : eol=@
See FOR /? for details.
- 17 Oct 2019 02:38
- Forum: DOS Batch Forum
- Topic: CAD start based on license Bundle check
- Replies: 3
- Views: 3981
Re: CAD start based on license Bundle check
See code below for how I interpreted your requirements (not everything was clear to me). It is merely a rough sketch of the logic you could use; not read-to-run code. As I don't have enough time to visit this forum often (unfortunately), don't expect quick responses from me. But the good people on t...
- 09 Oct 2019 14:57
- Forum: DOS Batch Forum
- Topic: Remove Microsoft header from cmd, for example when executing code from alternate data stream
- Replies: 10
- Views: 6320
Re: Remove Microsoft header from cmd when executing code from alternative data stream
Or ...
add /K to your original command to get rid of the version info:
and
Succes ermee!
add /K to your original command to get rid of the version info:
Code: Select all
>>%adsfile%:test%%i echo cmd /d /q /k ^<".\%adsfile%":test!next!
Code: Select all
cmd /d /q /k < %adsfile%:test1
Succes ermee!
