Search found 205 matches

by pieh-ejdsch
28 Dec 2018 06:55
Forum: DOS Batch Forum
Topic: compare by date/time
Replies: 2
Views: 591

Re: compare by date/time

Hello sajjansinghania,

you can use robocopy /?

Phil
by pieh-ejdsch
04 Nov 2018 10:45
Forum: DOS Batch Forum
Topic: Code snippet inadvertently prevents console title renaming
Replies: 3
Views: 758

Re: Code snippet inadvertently prevents console title renaming

Hello Quisquose, 2. Try writing the shortcut like this: cmd /k "prompt $g $S & pushD "C:\Users\username\Desktop\CMD test" & title "Rebuild Icon Cache" & color d1 & Program & prompt Testing-prompt $g" You either have to enter the path into the variable Path or use PushD to switch to the directory whe...
by pieh-ejdsch
03 Nov 2018 08:16
Forum: DOS Batch Forum
Topic: call expands variables / parameters differently with double percent signs
Replies: 1
Views: 599

call expands variables / parameters differently with double percent signs

Hello Reader, The question was asked about the possibility to pass more than 10 parameters in one line. Do not be surprised %0 is also a parameter. When reading from all parameters, which are passed to the batch file, I am not quite satisfied with some solutions. For more than 10 parameters, you mus...
by pieh-ejdsch
13 Sep 2018 10:53
Forum: DOS Batch Forum
Topic: Show date in order I want it to
Replies: 4
Views: 1601

Re: Show date in order I want it to

in this Forum you can Search for
timestamp

Phil
by pieh-ejdsch
02 Sep 2018 10:53
Forum: DOS Batch Forum
Topic: Exist in /s "directory"doesn't work
Replies: 12
Views: 1823

Re: Exist in /s "directory"doesn't work

than use xcopy Note: Xcopy /L /U /Y /D:m-t-y ... does not check whether the target file is more up-to-date, but outputs the source file name if the specified date is the same as or older than the source file and the target file is also present. Only: Xcopy /L /U /Y /D ... this will Output all NOT up...
by pieh-ejdsch
01 Sep 2018 00:02
Forum: DOS Batch Forum
Topic: Exist in /s "directory"doesn't work
Replies: 12
Views: 1823

Re: Exist in /s "directory"doesn't work

Hello
A small modification

Code: Select all

@echo off
pushD %userprofile%\desktop\F2
for /r %%i in ( *.pdf ) do (
  if exist "..\F1\%%~nxi" ( move /y "..\F1\%%~nxi" ..\F3
  ) else echo File %%~nxi is not a duplicate
)
popD
Phil
by pieh-ejdsch
28 Aug 2018 10:27
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 40073

Re: foolproof counting of arguments

instead of start "" / b ...
what happens if you
do it without /b?

Phil
by pieh-ejdsch
21 Jul 2018 01:03
Forum: DOS Batch Forum
Topic: Delete lines based upon string or file
Replies: 9
Views: 1622

Re: Delete lines based upon string or file

ups my mistake.
I forgot that filenames should be used in the for /f loop with the usebackQ option.
this damn cellphone.
by pieh-ejdsch
20 Jul 2018 09:27
Forum: DOS Batch Forum
Topic: Delete lines based upon string or file
Replies: 9
Views: 1622

Re: Delete lines based upon string or file

used a combination with a for / f loop and a normal for loop. in the filter file can end semicolon, comma and space. in between, however, not - as well as no special characters like & () *? <> = | " >tempFilterFile ( @ for /f "delims=" %%i in ("filterFile") do @ ( for %%j in (%%i) do @ echo %%i ) ) ...
by pieh-ejdsch
19 Jul 2018 13:55
Forum: DOS Batch Forum
Topic: Delete lines based upon string or file
Replies: 9
Views: 1622

Re: Delete lines based upon string or file

if you use the file, without a concluding comma at the end of the line, you can also filter it with

Code: Select all

findstr /v /g:filterFile inputfile >outfile
Phil
by pieh-ejdsch
18 Jul 2018 11:56
Forum: DOS Batch Forum
Topic: Replacement of Operator
Replies: 10
Views: 2062

Re: Replacement of Operator

Hello,
You only make this special replacement by

Code: Select all

:replace
for /f "tokens=1*delims=~" %%i in ("!vheader!") do (
  if .%%j neq . (
    set "vheader=%%i","%%j"
    goto :replace
  )
)
echo !vheader! 
Phil
by pieh-ejdsch
13 Jul 2018 06:58
Forum: DOS Batch Forum
Topic: Batch file to copy folders & files except few
Replies: 2
Views: 728

Re: Batch file to copy folders & files except few

Hello anupam,
With xCopy /s folder1\file1 destination /exclude:list.txt
.. you can give a list with excluded paths.
See also xCopy /?

Phil
by pieh-ejdsch
26 Jun 2018 14:14
Forum: DOS Batch Forum
Topic: Change the influence of one batch file when other one is running
Replies: 3
Views: 1195

Re: Change the influence of one batch file when other one is running

Hello
To communicate from one to two you can use waitfor.
Otherwise open a writing handle from set /p into your one - in two test this writing handle also into one, if this doesn't success then goto yourLabel.
Phil
by pieh-ejdsch
22 Jun 2018 02:27
Forum: DOS Batch Forum
Topic: Creatively stupid ways to rename files with spaces to underscores
Replies: 10
Views: 2382

Re: Creatively stupid ways to rename files with spaces to underscores

I also tinkered a bit. I did not want to think about why I should make a goto out of the for loop. That makes no sense - but that's exactly why it should turn here. And well I admit it, I screwed up the loop with the delayed variable itself. - I was lazy - and had typed this snippet on the smart pho...
by pieh-ejdsch
21 Jun 2018 09:00
Forum: DOS Batch Forum
Topic: which wildcard can be used in this case??
Replies: 13
Views: 2771

Re: which wildcard can be used in this case??

You do not have to add the file extension additionally. This is done in the variable with the for extension "%%~nxi".