Search found 1567 matches
- 01 Sep 2018 17:39
- Forum: DOS Batch Forum
- Topic: Exist in /s "directory"doesn't work
- Replies: 12
- Views: 4076
Re: Exist in /s "directory"doesn't work
Hello A small modification @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 assuming DATE format: dayName day/month/year assuming TIMESTAMP format: Phil It works. Thanks for...
- 01 Sep 2018 10:05
- Forum: DOS Batch Forum
- Topic: Refreshing desktop and running script on the background
- Replies: 9
- Views: 4317
Re: Refreshing desktop and running script on the background
I don't see any good possibility to refresh the desktop using batch. echo. &<nul set /p "= :/ Restart 'explorer.EXE' :: ( >nul taskkill /im explorer.EXE /f &&start explorer.EXE <nul set /p "= :/ Restart 'explorer.EXE'" :: ) <nul set /p "= [OK]" &echo. This will work but you will loose all active ex...
- 01 Sep 2018 09:55
- Forum: DOS Batch Forum
- Topic: Automatically enter the login details batch file
- Replies: 2
- Views: 5064
Re: Automatically enter the login details batch file
Hi, I have created a batch files that open a few websites in chrom. My problem is that i would like it to open them and enter the login details like : email and password and user and password. can some one help me? Code: @ECHO OFF SET BROWSER=chrome.exe SET WAIT_TIME=2 START %BROWSER% -new-tab "htt...
- 01 Sep 2018 09:31
- Forum: DOS Batch Forum
- Topic: find string in logs directory, send email
- Replies: 4
- Views: 1835
Re: find string in logs directory, send email
I would like to monitor a directory of logs for specific occurrences of memory issues. Manually I run findstr -s *Heap.memory" from the command prompt. I'm looking for some help/expertise to have a batch file I could run as a windows scheduled task daily, initiate a search of the logs and if a stri...
- 31 Aug 2018 07:51
- Forum: DOS Batch Forum
- Topic: How to Use FC (File Compare) from the Windows Command Prompt
- Replies: 4
- Views: 5358
Re: How to Use FC (File Compare) from the Windows Command Prompt
i fear it's comparing the contents of all files rather than just telling which files exist in folder1 that are missing in folder2. Yes, FC just compares the file contents nothing more. You mean something like this? Honestly I get confused as I'm sure you know this. for %A in (folder1\*) do @if not ...
- 31 Aug 2018 04:41
- Forum: DOS Batch Forum
- Topic: How to Use FC (File Compare) from the Windows Command Prompt
- Replies: 4
- Views: 5358
Re: How to Use FC (File Compare) from the Windows Command Prompt
I downloaded winMerge, it just compared both folder trees in only a few minutes.
It tells me which files exist in one folder but not in the other, which files are identical and which are not.
It tells me which files exist in one folder but not in the other, which files are identical and which are not.
- 31 Aug 2018 03:43
- Forum: DOS Batch Forum
- Topic: Help with a Batch Macro
- Replies: 1
- Views: 1016
Re: Help with a Batch Macro
Post the complete code also batch2, I don't like guessing what you are doing. batch1 seems to accept only a single parameter %%1 and %MUSIC% seems to handle also only a single parameter. then batch1.CMD "mySongPath/mySong.MP3" should simply work. You can execute %MUSIC% JazzBeat3 from batch2 in two ...
- 31 Aug 2018 03:19
- Forum: DOS Batch Forum
- Topic: How to Use FC (File Compare) from the Windows Command Prompt
- Replies: 4
- Views: 5358
How to Use FC (File Compare) from the Windows Command Prompt
So I have 2 windows server 2003 enterprise images. -One is windows server 2003 enterprise R2 SP1 VLK. This is a problem, many of my old programs cannot to be installed correctly if installed after SP1 is installed. I don't need R2 but could not find a way to disable R2 inside unattended.sif -The oth...
- 01 Jun 2018 20:10
- Forum: DOS Batch Forum
- Topic: Any way to send log file or txt file into email
- Replies: 5
- Views: 2765
Re: Any way to send log file or txt file into email
Hi all, It looks like that batch file itself can not send any log file or txt file into email recipient. Which one you suggest to use, I looked up on internet and blat is the one.. My purpose is to send out the log file and some error txt file into several email recipients to alert for the batch jo...
- 25 May 2018 21:49
- Forum: DOS Batch Forum
- Topic: Weird function issue - variables not staying set
- Replies: 3
- Views: 2106
Re: Weird function issue - variables not staying set
However, %EXP% isn't staying set. What am I doing wrong? Thanks! The problem is in these lines :GET_DOW ... SETLOCAL & SET "EXP=%BKUP_DY%,%BKUP_WK%,%BKUP_MO%,%BKUP_YR%" ... GOTO :EOF When local scopes are used variables you intend to keep need to be explicitly pushed over the endlocal border for th...
- 25 May 2018 10:25
- Forum: DOS Batch Forum
- Topic: Get arguments without temporary file
- Replies: 24
- Views: 8193
Re: Get arguments without temporary file
I optimized the code a bit for macronisation, remove labels, findstr. That looks quite good, BUT to remove the findstr after 'doskey /macros' isn't a good idea, as it sets any amount of variables, for each defined macro, and it can even collide with predefined variables like CD/path ... I know, I s...
- 24 May 2018 13:46
- Forum: DOS Batch Forum
- Topic: Get arguments without temporary file
- Replies: 24
- Views: 8193
Re: Get arguments without temporary file
I optimized the code a bit for macronisation, remove labels, findstr. @echo off echo. set "var=getParams.cmd "^^" ^^_^&^|^<^>%%#"" set "var" call %%var%% set args setlocal enableDelayedExpansion cmd /c !var! set args endlocal echo. set "var=getParams.cmd "^^" ^^^!^&^|^<^>%%#"" set "var" call %%var%%...
- 23 May 2018 20:14
- Forum: DOS Batch Forum
- Topic: Get arguments without temporary file
- Replies: 24
- Views: 8193
Re: Get arguments without temporary file
Because (as I said) a name of your script may be t&st.cmd or other toxic symbol and in a path too or blah blah ... As long as you are dealing with characters inside the codepage it works. cmd /S /D /C ^" "t&st.cmd" ^" cmd /S /D /C ^" "t^st.cmd" ^" And try carrets in an argument instead of ampersand...
- 23 May 2018 13:21
- Forum: DOS Batch Forum
- Topic: Get arguments without temporary file
- Replies: 24
- Views: 8193
Re: Get arguments without temporary file
Here my three ideas which I didnt follow yet and which may or may not be usefull. 1) if I need to run again my script this way cmd /S /D /c""%~f0" "argument inside" it is a problem because cmd deletes the first and th last double-quotation mark and that is a problem because of argument and also bec...
- 23 May 2018 07:35
- Forum: DOS Batch Forum
- Topic: Get arguments without temporary file
- Replies: 24
- Views: 8193
Re: Get arguments without temporary file
I tested @echo off &setlocal enableDelayedExpansion (set LF=^ %=empty=% ) set "arg=simple text" set arg &call tst.cmd %%arg%% set "arg=special unquoted &|<>%%!^#" set arg &call tst.cmd %%arg%% set ^"arg=special quoted "&|<>%%!^#"" set arg &call tst.cmd %%arg%% set "arg=&"^&" set arg &call tst.cmd %%...