[Solved] move file based on the less than max system modified date available

I don’t know if you were aware, but the other step you tried was powershell.exe code not cmd.exe. Something similar to this may do what you require: @Echo Off Set “dirSrc=C:\App\Folder1” Set “dirDst=C:\App\Folder2” Set “extSrc=*.txt” If Exist “%dirSrc%\%extSrc%” (CD /D “%dirSrc%” 2>Nul || Exit /B ) Else Exit /B If Not Exist “%dirDst%\” (MD “%dirDst%” … Read more

[Solved] Create a timestamp folder with today’s date and time and copy some folder to it

Here is something you can try: @echo off rem Create datestamp: set “datestamp=%date:~4,-8%_%date:~7,-5%_%date:~12,2%” rem Request for me, if you are not using `dd/mm/yy` format, to provide another script for your occassion. rem Create timestamp: set “timestamp=%time:~0,2%_%time:~3,2%” rem Create folder: md %datestamp%_%timestamp% xcopy /E “C:/Program Files (x86)/Jenkins/workspace/jenkins Pipeline/application/bin/Debug/netcoreapp2.1/os/publish” “%datestamp%_%timestamp%” Hope this helps! 0 solved Create a … Read more

[Solved] how to use batch file variable within text file?

Based upon my understanding of your question, you could try: @For /D %%A In (“C:\input\*”)Do @( (Echo path=C:\Metadata_input\%%~nxA\ Echo elec_path=C:\OHD\%%~nxA\)>”C:\file_move.txt” Call “E:\FileMoving_run.bat” –context=Default –context_param prop_file_move=”C:\file_move.txt” ) @Del “C:\file_move.txt” 6 solved how to use batch file variable within text file?

[Solved] Contents of file 1.txt between specific word in tag of file 2 in batch/powershell [closed]

Following should get you started $housenames = @(“Dagger Alley 1” “Steel Home” “Iron Alley 1” “Iron Alley 2” “Swamp Watch” “Salvation Street 2″ ) $xmlTemplate = @( ‘<house name=”” houseid=”2″ entryx=”0″ entryy=”0″ entryz=”0″ rent=”0″ townid=”0″ size=”93″ />’ ‘<house name=”” houseid=”4″ entryx=”0″ entryy=”0″ entryz=”0″ rent=”0″ townid=”0″ size=”68″ />’ ‘<house name=”” houseid=”5″ entryx=”0″ entryy=”0″ entryz=”0″ rent=”0″ townid=”0″ … Read more

[Solved] Batch program not starting on Windows 10 [closed]

Batch Label should be defined as :desktop as opposed to desktop: and syntax for taking input from user is set /p desktopoptions= “Enter choice” ^Note the space after equals sign. while your code p /set desktopoptions= and there’s no such command named ‘quit’. I’d recommend if %desktopoptions%==1 goto serverstart if %desktopoptions%==2 goto exit :exit cls … Read more

[Solved] Get a list of network folders and the path to them [closed]

Continuing from my comment. For example: Listing Network Drives There are many ways to list mapped network drives. One of them uses PowerShell’s Get-PSDrive and checks to see whether the target root starts with “\”, indicating a UNC network path: Get-PSDrive -PSProvider FileSystem | Where-Object DisplayRoot -like ‘\\*’ # Results <# Name Used (GB) Free … Read more

[Solved] Download and run files using PowerShell [closed]

To answer part of your question: Using Invoke-WebRequest you can feed it a url and use the parameter -OutFile to send it somewhere locally on your machine, example: $url = example.com/somefile.jpg Invoke-WebRequest $url -OutFile C:\output\somefile.jpg This will download the somefile.jpg from example.com and save it in C:\output\ on your machine https://msdn.microsoft.com/powershell/reference/5.1/Microsoft.PowerShell.Utility/Invoke-WebRequest 7 solved Download and … Read more

[Solved] How to do 2 commands at the same time using batch

With if exist use the variableNAME, not the variable itself (no %) Your line if not defined %answer% echo Not an acceptable answer & goto READYTOBEGIN? is parsed (because %answer% is empty) as: if not defined echo Not an acceptable answer & goto READYTOBEGIN? echo is also not defined (probably), so the command to be … Read more

[Solved] How to convert batch file (.bat) to .cmd file

convertBatToCmd.bat: @echo off echo ConvertBatToCmd.bat if not exist “%1” echo call with file to be converted as parameter & goto :eof ren “%1” “%~n1.cmd” Usage: convertBatToCmd myfile.bat (sorry, couldn’t resist…) back to seriousity: more infos here 2 solved How to convert batch file (.bat) to .cmd file

[Solved] change word inside multi TXT and save same name [duplicate]

Without utilising another tool/language, batch file solutions will generally write a new destination file before deleting the target file and performing a rename. Here therefore is an option utilising the built-in PowerShell scripting language: From a batch file, with the text files in the current working directory: @PowerShell -NoLogo -NoProfile -Command “Get-ChildItem ‘.\*.txt’|%%{(Get-Content $_.FullName) -CReplace … Read more