Text file containing a sequence of commands or program invocations.

learn more… | top users | synonyms (1)

3
votes
3answers
99 views

Batch command how to make a list for set /p

I am trying to make a batch script that asks for user input. The user input should be limited to certain words. If the user enters any other words than e.g. (eng, ger, fra) the user will get an echo ...
0
votes
0answers
44 views

What does the %% signs in batch file refer to and where are they read from

I actually have a lot of questions about .bat (or .batch) files is there a specific language for batch files? and is there an online resource(s) to learn it? For example in a program-A when I open ...
0
votes
1answer
15 views

Run several processes in cmd window with ConEmu

I'm using ConEmu with Windows 8.1. I need to write a BAT-file, which will run ConEmu and open several cmd-shell tabs, running a process in each of it. Right now my file looks like this: start ...
0
votes
2answers
3k views

Cut a part from a filename (windows batch)

I got files named like this: cam1(word1 word2 wordN) (24-04-2012 00-11-13).mpg cam2(word1 word2 wordN) (24-04-2012 00-11-13).mpg cam3(word1 word2 wordN) (24-04-2012 00-11-13).mpg Need to cut (word1 ...
0
votes
2answers
27 views

Copying and renaming of .xlsm files using batch

Its glad to be here and i am really excited n new to batch scripting. I have been using a batch containing below for copying an excel from one folder to another { @echo off cp -r ...
1
vote
2answers
58 views

How can I tell if my batch file is running?

I have a batch script which is run from an AT command, and may get run more than once. When it starts, I need it to detect if it already running, and if so, exit (the second one) immediately. It ...
-1
votes
4answers
6k views

Simple batch file fails on Windows Server 2012

On a Windows 2012 Server, from a logged-in Administrator (local and domain), created a batch file "test.bat" by redirecting console input into a file: echo Hello When run from PowerShell cmd prompt ...
0
votes
3answers
34 views

Batch file to run programs as admin - error 740

I am working on a small batch script that elevates basic windows programs to run as administrator. All of the functions work fine but I have ran into a problem when trying to run "regedit.exe". When ...
0
votes
3answers
5k views

/ was unexpected at this time

I am getting "/ was unexpected at this time." while using the below for loop for some cases only. for /f "tokens=1,* delims=;" %%m in (file.txt) do ( echo Inside Loop echo %%m ) I'm ...
0
votes
1answer
25 views

can you start a program at windows startup using bat file and send it file path

can a bat file or vbs file take an argument (a path to an exe file) then create a shortcut to that file and place in the startup folder or add a registry entry to run that exe at windows startup but ...
0
votes
0answers
25 views

Autorun a bat file after a predefined inactive period

Is there a way to auto run the following command after a predefined inactive time? manage-bde -lock G: This DOS command activates the bit lock on windows on a removable G drive. I want preferably ...
2
votes
3answers
4k views

How to set to a variable, the result of a expression

I need to extract the date of a file, for then use this string as part of the name of a new file. I trying to solve this using the next commands: First I get the details of the file and redirect the ...
0
votes
1answer
56 views

Windows batch file not running when I double click, how to restore association with cmd.exe?

Windows 8 64-bit. The user I'm logged in as has admin rights. When I open a cmd windows the window title even says "Administrator: cmd.exe". So, I set my .bat file association to have the .bat file ...
-4
votes
2answers
365 views

windows 7 batch file for swapping filenames randomly

I need to write a batch file that goes into a folder and randomly swaps (renames) all the filenames. This folder has about 1000 files. So it is acceptable if there are few misses.
1
vote
1answer
17 views

Run Atom using a bat file after changing directory

I have writen in my bat file cmd /k cd /d"C:\Users\amanz\Desktop\Introduction - Computing\Java files" call atomer.bat right now, it just seems to change the directory and stops right there. It ...
2
votes
1answer
31 views

Batch command delete from list of files from multiple computers

Currently I use a poor piece of programming where I delete multiple files on multiple PC's. What I would like to do is have a file with the names of the PC's (PC.txt) and a file (filedel.txt) with ...
0
votes
1answer
20 views

Open an executable with a parameter?

I'm trying to open putty with my server data loaded through a batch file. I tried start "OVH" "C:\Program Files (x86)\PuTTY\putty.exe -ssh username@ip.address -pw password", and that did not work; ...
0
votes
1answer
20 views

Batch file to detect when a device connects to hosted wireless hotspot on a laptop

I have created a wireless hotspot on my laptop using: netsh wlan start hostednetwork This works perfectly. I have a raspberry pi that automatically connects to this network automatically, however ...
-1
votes
0answers
14 views

adwcleaner to work alone and hidden [closed]

I'ld like top have a batch file that make adwcleaner to work alone and hidden, along with another simple program. Like one press button for the job to be done. In order to create something similar to ...
3
votes
1answer
51 views

Batch file FOR loop to copy folders only if they exist in another folder

I'm trying to write a batch file that copies folders from one folder location to another, but only if they exist in a third folder. That sounds confusing, I'll try again. I have the following 3 ...
-1
votes
0answers
15 views

Windows Update on multiple servers [migrated]

I have about 500+ servers( Win 2003, 2008, 2012). At the moment patches are set to available by SCCM. We need to login to the servers and download n Install the patches. Once it done we restart the ...
1
vote
1answer
18 views

Bat file doesn't log when running from task scheduler?

I made a bat file which restarts 2 services, and I have it run in task scheduler. If I run the bat file normally, I can see it logging in current directory as the bat file. But if I run it through ...
1
vote
1answer
35 views

Need assistance with an existing batch file

I need a batch file that I can leave running, and if "Unturned.exe" is not running do START "" /B "C:\Users\Administrator\Desktop\1.lnk", and then idle, scan, and wait for it to shutdown again in a ...
0
votes
1answer
30 views

In Windows cmd batch file how to ignore carriage return

I have a Win 7 bat file that prompts user to enter a number, then it passes that number as an argument to a tcl script. An optical barcode scanner is used to provide the number, but then I want user ...
1
vote
1answer
19 views

Multiple line Windows Batch File issue

I have a batch file with following contents Line 1 "C:\Program Files (x86)\Dell\SysMgt\bmc\ipmish.exe" -interactive -ip 192.168.1.5 -u root -p Password after this it goes to prompt IPMISH> Line 2 ...
0
votes
0answers
23 views

Write on screen directly on top of everything

Is there any way to make some huge text appear on screen on top of everything? something as shown below. I know I can use Rainmeter but i need something that can be used in batch files.
1
vote
2answers
5k views

Batch file to install TotalCommander without User intervention

I am new to windows batch file. Here is my first attempt in batch file. Here is my requirement: I should have batch file. When executes, it should read the XML config file for the software list to be ...
0
votes
0answers
21 views

Run local bat file from Chrome or Chrome extension

In my project I have an internal tool made of web page. To evolve this tool I would like to run on request, another tool installed on the client machine. There is a way to do so? The second tool is ...
1
vote
3answers
8k views

Upload folder with cURL and FTP using Batch file on Windows?

I am trying to upload a whole folder, including it's sub-folders and files to a folder on my server from a Windows batch (.bat) file. Below is the command I have for the Upload part... curl -T ...
0
votes
1answer
57 views

Run a .bat file with CMDER

I have a .bat file that I want to run in Cmder not CMD echo off :begin echo Select a task: echo ============= echo 1) P1 echo 2) P2 echo - set /p op=Type option: if "%op%"=="1" goto op1 if ...
0
votes
0answers
22 views

Error level of a for command in a batch script

I am trying to get the error level of the isql command executed in a for loop. But I always get 0. for /f "skip=4" %%i in ('echo SELECT COALESCE^(MAX^(ID^)^,0^) FROM LOG^; ^| %isql% -B -Q -U SYSDBA ...
-1
votes
0answers
16 views

Deleting PDFs on a daily basis [duplicate]

I'm using W7E and I generate a lot of reports in PDF format on a daily basis. What I am looking to do is have a script that will run once a day on its own, and at a specified time. It will then look ...
1
vote
2answers
3k views

bat file to open up a chrome browser window with no toolbars

How to use a bat file to open up a chrome browser window with no toolbars.(just like a popup window) @echo off start "Chrome" chrome --new-window http://localhost/jayambe/ this code when run opens ...
1
vote
1answer
21 views

Copy specific folders on Windows (robocopy)

I want to do some thing simple (I thought...) I've got something like this: Folder01 |_File1 |_File2 |_File3 Folder02 |_File1 |_File2 |_File3 Folder03 |_File1 |_File2 |_File3 ...
0
votes
1answer
3k views

String replace inside a for loop in bat script

The replace is go well in this script. I am trying to make it dynamic. SETLOCAL enabledelayedexpansion for /f "tokens=* delims= " %%a in ...
0
votes
1answer
1k views

run multiple commands from a file after logging into putty from a bat file

I have written a bat file in which I have the following: putty.exe -t -load "ABC" -l username -pw password -m "C:\Users\pathasai\Desktop\abc.txt" In my abc.txt I have written some commands which I ...
1
vote
2answers
41k views

Create new directory with batch file (MKDIR not working)?

I tried using at first a combination of xcopy and del, but del kept failing. xcopy creates directory if it doesn't yet exist. The other option is to use MKDIR but it does not work inside a batch ...
-2
votes
0answers
17 views

Is there a label/goto in python? [migrated]

We can use goto and :label in batch. Is there anything like it in Python? I am a beginner in python. Thanks SuperUser
0
votes
1answer
50 views

How can I create a shortcut to launch a batch file one folder up?

I have been trying to create a shortcut to launch a batch file one folder up from the shortcut location. I have not been able to find and answer this. I have been able to solve this using an ...
1
vote
1answer
21 views

Rename folder of files from epoch (unix time) to month-day-year-hour-minute-second?

I have a folder full of recordings which all read: " rec.(unixtime).mp3 " ex: "rec.1447666687584.mp3" ideally turns into something like "10-16-2015_01-38-07.mp3" I need to convert these filenames ...
2
votes
2answers
183 views

extract data from output in bat file

I want to add my ip to system/user environment in a bat file. This is the code of the bat file curl http://httpbin.org/ip This is the output: { "origin": "1.2.3.4" } I want to set ...
-1
votes
0answers
13 views

I would like to use a .bat file to clean up files (delete) in subfolders but leave a weeks worth of files [duplicate]

I would like to use a .bat file to clean up files (delete) in sub folders ie..F:\Captures(40 sub folders) but leave a weeks worth of files. Would this be possible? Or would i need a separate .bat file ...
-1
votes
2answers
53 views

Delete files when names do not correspond with parts of strings in txt file - Windows batch

There is a txt file, which contains (among many others) strings, which start with: "HH:MM:SS case" where H, M, S are hours, minutes and seconds (in 24h format). There are .jpg files, with names ...
2
votes
1answer
135 views

How to hide error dialog box in 7zip?

I am using "C:\Program Files\7-Zip\7zG.exe" -y x -pmypassword "D:\Myfile.rar" -o"D:\Extracted Files\" for extracting a file encrypted with password. Now if 'mypassword' is not the correct password ...
1
vote
1answer
10k views

Batch file script for Enable & disable the “use automatic Configuration Script”

My intention is to create a .bat file that toggles the check box of "use automatic Configuration Script" in Internet Settings. The following is my script @echo OFF setlocal ENABLEEXTENSIONS set ...
1
vote
1answer
17 views

Run batch job periodically after a process has terminated

I used FreeFileSync to create a batch job to backup my Firefox profile and I'm not sure how to run it periodically (every hour or so) or after Firefox has been closed. FreeFileSync's website ...
0
votes
1answer
17 views

Windows console aliases in any cmd.exe? Is it possible?

Thanks to similar questions, i figured out how to use aliases in Windows. I created *.bat file with content: DOSKEY tf=npm run testCucumberFirefox DOSKEY tc=npm run testCucumberChrome DOSKEY tie=npm ...
0
votes
1answer
38 views

Move files of particular pattern in batch to another folder [closed]

I am trying to write a Windows batch file with commands for moving files with a pattern the file name from one folder to another folder, and others to others. For example: vision.xls should go to a ...
2
votes
2answers
5k views

Looking to create a batch file capable of editing a line (or word) in a text file

I have a text file (...\config.txt) containing 2 lines which looks like: Preamp: -4 dB Include: surround.txt I need to change "surround" to "headphones" in that config file. I really need to make 2 ...
-2
votes
1answer
30 views

Adding a registry key via batch file [duplicate]

could anyone tell me how exactly to do this via a batch file: https://support.microsoft.com/en-us/kb/3123303 The x86 version. Much appreciated.