Category "batch-file"

batch file from scheduled task returns code 2147942401

I am trying to schedule a job to run a batch file with Windows 10 Task Scheduler, but it results in return code 2147942401. The batch file is on remote locatio

Get files with latest date from SFTP server using WinSCP in batch file

Hi I am totally new to WinSCP and Batch. I have figured out a script to transfer a folder from an SFTP site to my computer but would like to only grab the late

What does percent sign with tilde syntax(%~a) mean in command line [closed]

for %a in (*.txt) do ren "%~a" "%~na version 1%~xa" This command line script can rename files in a directory by adding text ( version 1) to th

How can I split text when there's an uppercase character? [closed]

I am making a batch file where I want to say "welcome <username>" but the username could be, for example, like "HiThere" and I want to p

How to create a .bat file which execute python file

I'm new to bat file and started to implementing it. I have a list of linux application commands which starts my application. I have a windows system to deploy,

Echo off in bat file isn't working

So I wrote a short bat file which creates user and some more: @echo off net user egzamin /add net user egzaming /expires:17/07/17 net user egzamin /logonpasswo

Why does the command "Timeout" in a batch file suddenly not work anymore?

Did I miss a change of the Windows internal "timeout" command? I have a batch file for a long time now that shows me the version number of a program. I added t

Why does the command "Timeout" in a batch file suddenly not work anymore?

Did I miss a change of the Windows internal "timeout" command? I have a batch file for a long time now that shows me the version number of a program. I added t

How to execute a batch file on uninstall in Inno Setup?

I'm using code from How do you execute command line tools without using batch file in Inno Setup response to execute all my batch files on installation (before,

batch script - write all files found in one directory into one command line?

I have a directory with a bunch of files with a mix of extension. I only want to work with files with extension *.abc. Each *.abc file should then be handed ove

Looking for a Batchfile script to delete a folder when location is dynamic

I want to delete all the contents of a folder (Google) across different systems from "C:\Users\xxxxx\AppData\Local\Google" using a batch file, but across all sy

Is there a way to hash a command output without the use of a temp file?

In command-prompt you can see the md5 or other hash of a file using certutil -hashfile <filepath> <hash algorithm>. This was the only option I can f

Opening project in VSCode using batch file

Disclaimer: I read this and this before, but it doesn't work as I want. Description: I decided to create set of batch files for convenient way to run different

CMD batch - encode file to base 64 and trim characters and new line

I'm trying to make a batch file from CMD with the following commands: Convert file to base 64 - using certutil command this is how the contents of the base 64

Why is %random% in Windows time based and how to get a real random number?

I use the following script: set /a num=%random% %%1000 +3000 timeout /T %num% taskkill /F /IM chrome.exe I trigger it using Windows task scheduler on multipl

How to compress each subfolder in a folder into separate RAR archives with rar.exe using a batch script?

I have multiple folders inside N:\working. N:\working\1 N:\working\2 N:\working\3 I want to RAR compress them all individually on 64-bit Windows. Here is the

Behavior of bat and Powershell is different when clicked vs run from respective consoles, specifically with git

This post appears wordy, but there's actually not much here to read. Just figured more details > less details. I am working on some tools to speed up my git

check ProxyEnable in a batch file

I currently have two batch files: proxy_enable.bat reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" ^ /v ProxyEnable /t REG_DWORD

How to Detect Multiple Monitors in a Batch File

I have recently started diving into writing Batch files and I have a question. I'm trying to create a file that checks to see if my secondary monitor is connect

Get DNS resolution time with BATCH (cmd)

I'm trying to obtain the resolution time of my DNS server, but I'm not sure that I'm doing it well. First of all I tried to make a ping to my DNS server IP, a