Windows XP or later Windows: How can I run a batch file in the background with no window displayed?

Here is a possible solution: From your first script, call your second script with the following line: wscript.exe invis.vbs run.bat %* Actually, you are calling a vbs script with: the [path]\name o... Read More

windows - How do I execute several git commands in a batch file without terminating after the first command?

I'm not sure if this is true for all Windows git packages, but at least some use a git.cmd script as a wrapper around the actual git executables (for example git.exe). So when you're batch file uses... Read More

Set a path variable with spaces in the path in a Windows .cmd file or batch file

Try something like this: SET MY_PATH=C:\Folder with a space "%MY_PATH%\MyProgram.exe" /switch1 /switch2... Read More

windows - XCOPY: Overwrite all without prompt in BATCH

The solution is the /Y switch: xcopy "C:\Users\ADMIN\Desktop\*.*" "D:\Backup\" /K /D /H /Y... Read More

Windows Bat file optional argument parsing

Though I tend to agree with @AlekDavis' comment, there are nonetheless several ways to do this in the NT shell. The approach I would take advantage of the SHIFT command and IF conditional branching,... Read More

How to execute programs in the same directory as the windows batch file?

Try calling the .exe with %~dp0, like this: %~dp0MyProgram.exe. %0 contains the full path to the called .bat file. ~dp says to get the drive and path, including trailing \.... Read More

windows - Find Process Name by its Process ID

The basic one, ask tasklist to filter its output and only show the indicated process id information tasklist /fi "pid eq 4444" To only get the process name, the line must be splitted for /f "delims=,... Read More

How can I get the file system location of a PowerShell script?

PowerShell 3+ The path of a running scripts is: $PSCommandPath Its directory is: $PSScriptRoot PowerShell 2 The path of a running scripts is: $MyInvocation.MyCommand.Path Its directory is: $PSScriptR... Read More

How can you find and replace text in a file using the Windows command-line environment?

A lot of the answers here helped point me in the right direction, however none were suitable for me, so I am posting my solution. I have Windows 7, which comes with PowerShell built-in. Here is the s... Read More

windows - Decoding base64 in batch

Actually Windows does have a utility that encodes and decodes base64 - CERTUTIL I'm not sure what version of Windows introduced this command. To encode a file: certutil -encode inputFileName encodedO... Read More