Text file containing a sequence of commands or program invocations that does not need user intervention.

learn more… | top users | synonyms (1)

1
vote
1answer
155 views

Commands run in a batch file only when writing cmd /c before

I am running the following command rabbitmq-server.bat" -detached This command runs a sewrver in the background. When I run it from a batch files - the flow stops and later commands in the ...
0
votes
1answer
4k views

Windows Batch file to copy latest files to a new folder

I want to copy the latest file from a Folder and its subfolders to a new location. The following code works well, BUT I do not want to filter by Date AND Time (/O:D), but DATE only, so that all ...
1
vote
1answer
212 views

How do I create a .bat to logoff a specific user from your pc?

Running remote desktops that are acting as specific users on Win7x64. The main username I'm using is Server. And the rest are as follows hh1 hh2 hh3 etc. Basically these handheld remote desktop ...
0
votes
1answer
87 views

Running a program as non-admin from an admin script? [duplicate]

I have a batch script that runs some programs at once. One of them requires admin access, so it's fine to manually give it. But now I am adding another admin program. I would not like to manually give ...
2
votes
1answer
97 views

What persistent information does the devcon hwids output contain?

I have a gaming keyboard (Logitech G15) that uses its own software for additional features. Now I am writing a startup batch script that starts that software if the keyboard is connected. It of course ...
1
vote
2answers
56 views

Is there a way to force all child batch files launched from a parent to log into one single file?

Suppose I am calling a parent batch file like this call parent.bat >Log.txt and within the parent.bat I calling other batch files which themselves call other bath files. Now whats happening is, ...
2
votes
2answers
976 views

Run a batch file when I lock/unlock my computer

Is there a way I can run a batch file upon locking my computer, and then run another batch file when I unlock it? (Windows 8.1) Thank you!
0
votes
0answers
44 views

How to start an application in a given directory, using other as its working dir?

For a system we are deploying for our customer we need to run the setup executable from %temp% and have it use for the installation, files in another directory. This cannot be solved at the ...
0
votes
0answers
80 views

Multithreaded FTP from Batch File Windows

I need to implement a multithreaded FTP upload of all files in the directory of an FTP server. Presently the batch file uses mget and to upload changes uses an mput. This very slow. I was looking into ...
0
votes
2answers
983 views

Batch File - Search for string and copy next word to new file

Good Day All. I want to search for the following string in a bunch of TEXT files in a folder: USER Then I want to copy the string next to this word (USER), and copy it to a new text file. How do ...
5
votes
4answers
13k views

Batch file with commands to run as administrator and standard user

I'm trying writing a batch file that needs to run some commands using a local admin account (start/stop a service) and some commands using the logged in user (copy files from the user directory) and ...
1
vote
2answers
683 views

How do I make a batch file the default application for a file type

I am trying to associate .svg files with a batch file that runs squiggle from batik. When I right click on an svg and select Open With and Choose Default Program, I get the usual window, which lists ...
0
votes
3answers
14k views

Run Batch file as administrator [duplicate]

I created a batch file which stops a service,then stops a process and then starts the service it stopped. When I execute the batch file, it says "access denied". I cannot figure out why it says ...
0
votes
1answer
186 views

Delete a file inside subfolder using bat

I know the name of the subfolder inside which the file I want to delete is located. The name of the subfolder is "My Subfolder" and the file I want to delete inside the subfolder is "The-Bad File.txt" ...
1
vote
2answers
53 views

Bat file to backup when the cable is connected [duplicate]

I need to do a Bat file (or something like that) that do a Incremental Backup of some especified folders when, and just when, the Ethernet Cable is connected. How can I do it? I have no idea how can ...
0
votes
1answer
433 views

How to extract part of a string between 2 delimiters, in Windows batch file?

I have a variable length string starting with START and ending with END as delimiters. I want to extract the string between START and END. I tried doing SET _result=%String:~6,-4% ECHO %_result% ...
0
votes
1answer
75 views

How do I remove whitespaces from my merged batch file

I'm trying to merge multiple text files into one single file. The problem with the command below is that it creates several whitespaces in the final merged file content and can't have any spaces. How ...
2
votes
2answers
889 views

Check Multiple if conditions in bat file/ and operator in bat

I want something like this:- if %ERRORLEVEL% GEQ 1 && %ERRORLEVEL% neq 255 GOTO Not closed by user . But this syntax is not working.
1
vote
2answers
2k views

How to schedule taskkill in bat file

I want something like this:- taskkill 7z.exe after 50sec. code 1 code 2 code 3 7z.exe will be killed after 50 sec but the program should execute code 1 code 2 code 3 without waiting for the ...
0
votes
1answer
493 views

Use Batch file to Run exe and Output Results to Text

I have a program that runs from the cmd prompt that will run continuously as it is outputting text. I can have it output the text to a text file by adding > path\filename.ext to the end. I want ...
0
votes
0answers
96 views

automate drive mounting after Cisco AnyConnect client is connected

I have a request to write a bash script for clients to open VPN connection and automount remote drives. I am not sure how to approach it. I figured out I can use "vpncli.exe connect " to connect, but ...
0
votes
1answer
2k views

Create a Batch file (.bat) to search an string through multiple files

I am using Windows Server 2008 and I need to create a Batch file (.bat) to search for a given string in 20.000 to 30.000 files located all in one folder in the same level (without subfolders). I have ...
1
vote
0answers
62 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 ...
2
votes
2answers
63 views

Delete file if found

I have a batch script with a line like this: del "%TARGET_DIR%\packages.config" But if packages.config does not exist in the target directory it produces an error. Could Not Find ...
0
votes
1answer
304 views

Bat file fails when file name has spaces

I have this batch file that process some video files in a batch. Things work just fine as long as the filename has no white spaces in it's name. If the file name (test movie.avi) has white space it ...
1
vote
2answers
2k 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 ...
0
votes
4answers
6k views

Make batch file run in the background of the command prompt while continuing to use command prompt

I am use a windows command prompt for hours a day at work, and I want to spice things up. I want my text color to change color every 1 second. I have a batch script that does this. @echo off set ...
2
votes
2answers
3k views

batch - File last modification time with seconds

I want to know when a file has been modified for the last time. I can get these infos using the following batch script: FOR %%i IN (myfile) DO SET modif_time=%%~ti The problem is that I need ...
2
votes
1answer
416 views

Running vim script exits batch file? (Windows .BAT/.CMD)

Trying to run a vim script as part of a batch file with vim -u NONE -S dothis.vim but what is puzzling is that the batch file exits after this line instead of continuing with the next statement. ...
1
vote
1answer
169 views

Batch - call another batch and have it executed

I am trying to get some batch files working. The first one I have (which works) takes a .rar from one drive to another and give the dir same name as the files put to rar and then copy a rename.bat ...
1
vote
0answers
306 views

Windows 8 “Insufficient memory” error whilst copying through .bat files

Info: Sys: Windows 8 Pro 64-bit (6.2, Build 9200) (9200.win8_gdr.130531-1504) BIOS: Default System BIOS Processor: Intel(R) Core(TM) i7 CPU ; 960 @ 3.20GHz (8 CPUs), ~3.2GHz Memory: 14336MB RAM ...
-1
votes
1answer
91 views

Removing folders with a batch-file

You will probably recognize the script below especially this command which was posted here over a year ago: for /f %%i in ('dir /a:d /s /b *PGP Corporation*') do echo rd /s %%i However, I am ...
0
votes
1answer
72 views

batch file to display nicely compare files results

I'm looking for a batch code to prepare a file with the differences between two files in a nice way, Maybe highlight individual lines in a different color, Does anyone have such a script?
1
vote
0answers
57 views

Sox not recognised as a command in W7

I just moved from xp-32bit to W7 64bit and re-installed sox which I use to resample and create spectrogams. The batch-file cd %~dp0 mkdir converted FOR %%A IN (%*) DO sox %%A -n spectrogram -o ...
1
vote
2answers
2k views

What causes SVN “Working copy <path> is locked”?

I wrote a console application that uses SharpSVN to update 3 folders in my repository. Wanted to convert that to a batch script to removed the dependency on SharpSVN. Came up with this: CD ...
1
vote
1answer
641 views

Changing virtual memory using batch

I am making a program using batch to boost pc performance and I have now come to the stage where I need to edit windows virtual memory to a size that I can change in the code. if needed it can be done ...
0
votes
1answer
268 views

Batch to check if removable disks are connected. If yes, execute another command

I know how to check if there are removable disks connected with a CMD command wmic logicaldisk where drivetype=2 get deviceid, volumename, description But now I would like to make a batch that ...
0
votes
4answers
93 views

Find IP in error.log

I'm having trouble building a batch code for find IP in a log using a text filter. For example: this line from Apache web server error.log: [Fri Dec 13 23:32:47.531250 2013] [access_compat:error] ...
1
vote
2answers
137 views

Detect a change in the number of files or folders

The following script is supposed to check if the number of files and folders has changed since the last time the batch-file was run. If so, it prints a message and updates the counts. Unfortunately ...
1
vote
2answers
398 views

Filling up the hard drive until certain amount of space is left?

I'm doing some testing of a product on Apple and Android devices. I'd like a script that will fill up the devices hard drive until 100KB space is left on the drive it's runs against to. Also in linux ...
2
votes
1answer
338 views

Making PowerShell assume the working directory of a called Batch file

I regularly work interactively with a batch script that I can't easily change. One of the features of this script is as a navigation aid - it understands my company/product's code layout conventions ...
0
votes
2answers
448 views

Can't quite get my batch file running invisibly

I found a lot of stuff online about creating invisible bat files. I came closest to wrapping my mind around this one: Run a completly hidden batch file However, in my application, I can't figure out ...
0
votes
4answers
694 views

Batch file rename script swapping substrings in filename?

I have a group of files named like title_december_word1_word2.png and want to iterate through the directory and swap word1 and word2 within each file. i.e. go from "button_december_state_pressed.png" ...
0
votes
0answers
99 views

Need PowerShell or BAT to delete PST if over certain size for GPO

I'm trying to delete "Internet Calendar Subscriptions.pst" from %LOCALAPPDATA%\Microsoft\Outlook using a BAT file. I can do this fine. But how do I delete only if it is over a certain size? When end ...
2
votes
2answers
192 views

Automate Windows scanning feature

I have a rather older Canon scanner Pixma MP 110. Of course, Canon does not provide any useful drivers (their site is really desperate, frustrating and useless in all means) - the only software I ...
-1
votes
1answer
49 views

change a .bat file to omit extensions when listing files in win 7

dir /b > filenames.txt Re named to .bat gives me file names with ext, I want to list without extensions, Any ideas anybody
0
votes
1answer
783 views

How can i bring an application to the front with a batch-script in WinXP

Like if it's no open, start the application otherwise bring the application to the front. I already have this script but i need it to bring it to the front: @echo off tasklist /FI "IMAGENAME eq ...
0
votes
1answer
554 views

windows script to copy text from one file into a new file

I am noob at coding! I am trying to create a windows script that I can copy text from one file into another. My main goal is to find lines in the text with "started processing" and "file". I am hoping ...
1
vote
2answers
709 views

how to access variables that are set in a different windows batch file?

i have a windows batch file - called fileA.bat, which contains a variable set in it. Sample code of fileA.bat: set fileA_username=michael now i have another batch file, called fileB.bat, which ...
0
votes
1answer
90 views

How to emulate bash select command in batch DOS?

Hi i have a variable containig a list of folders separated by a space, i want to present these elements each precedeed by a number, the user choses a folder by entreing the number associated with it, ...