Category "batch-file"

How to get process ID of a specific process using wmic and check on error?

I created a batch script which runs WMIC to get the PID from a specific process. If I open the bat script I see 'ProcessID 1234' or 'No Instance(s) Available.'

Using batch to close open image file or word doc

I am coding a choose your own adventure game. Im at the point where a player would have a choice to look at a poster or a document on a desk and the game would

Using batch to close open image file or word doc

I am coding a choose your own adventure game. Im at the point where a player would have a choice to look at a poster or a document on a desk and the game would

How to randomly generate names for each file in folder in batch file?

I want to rename all files in folder to random name but it wants to rename all the files to the same name: ren "c:\Test\*.txt" %Random%.txt pause Output: C:\Us

Switch JDK version in Windows 10 cmd

Is there a way to change JDK version easily in cmd? like the version on mac. Change Default JDK on Mac.

How can I deal with this error in my Batch script?

I'm not sure what is happening as batch script closes almost immediately when I try to run it. It's pretty simple it should test whether a number(num) is a prim

XCOPY Folder with Variable Name and Spaces

I want to create a batch that deletes files from some folders and then copies them back into them from another destination (another server). Some of these folde

How to process pathnames with ! within an for /F loop?

In a complex batch file I want to read in files with paths, among other things, to read them into a variable one after the other separated by spaces. This works

Windows batch - concatenate multiple text files into one

I need to create a script, which concatenates multiple text files into one. I know it's simple to use type *.txt > merged.txt But the requirement is to "con

Opening a gif full screen in a Batch Script [closed]

I have a batch script and I need it to open a gif file and display full screen. I have done research and all I can find is how to open the gif

comparing filenames with .bat and writing missing entries into .txt

i want to compare some files in a folder and then write missing ones into a text file. i've got a folder c:\sessions\ with files in it. those files are

Batch - Move file that start with pattern to a certain folder

I have a list of files organized like this: test%MM%YYYY%DD.txt, for example: test01201401.txt test01201402.txt test01201403.txt ... test02201401.txt test02201

delay a batch file in under a second?

Is there any way to delay a batch file in under a second, for example 10 milliseconds? I have tried to write this: ping localhost -n 1 -w 10 But it didn't w

Using call <file.bat> results in "sleep is not recognized as an internal or external command.."

I have a script that calls other commands in a for loop: for %%x in (%CMDS::= %) do ( call C:\%%x %1% echo "%%x complete" ) However, running this results

Installing list of programs using batch files [closed]

I wish to make a batch file that installs multiple programs :INSTALLER 1. 7-Zip 2. Adobe Creative Cloud ... ... 44. WinRAR 45. WizTree 46. Zoo

Is it possible to check if a two files shares the same name using batch file?

I have here a example directory that contains files with the same name but different extensions. - MAINFOLDER ˪ TEST.JPG ˪ TEST.PNG ˪ RAN

Why is a line added to .Body when creating mail?

I use an Outlook rule to run a batch file in Windows that takes as input the Subject and the Body of the email (this means two arguments). If I run the line dir

Time maximums in Windows shell and Why?

I made a simple countdown in Windows Batch Scripting: @ECHO OFF MODE con: cols=13 lines=2 COLOR 4f TITLE Countdown Timer SET /p m=? Minutes: SET /a s = 60 * m

Using BATCH file to install software (which I have working) and THEN create a shortcut file

Here is what I have so far: IF EXIST "C:\Program Files (x86)\Yawcam\Yawcam.exe" GOTO :eof ELSE start \\hazel\software$\YawCam\v6.0\yawcam_install.exe /SP- /V

calling devcon from inside windows forms not working

Plan The plan is to disable and subsequently enable a device from inside a windows forms application. To test the first building block of my plan, I open cmd wi