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

learn more… | top users | synonyms (1)

0
votes
1answer
248 views

Windows 7 - Launch Bat after installation (SetupComplete?)

I'm wondering about a script I made after the installation of my Windows 7 x64 ISO is done. The script (bat) contains this: @echo off cd C:\Users\ RD /S /Q "C:\Users\Public\" cd C:\Users\Unknown\ ...
1
vote
1answer
61 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
2k 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
131 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
67 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
59 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
47 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
336 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
37 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
55 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
412 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 ...
1
vote
2answers
4k 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
180 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
6k 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
101 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
42 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
244 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
56 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 ...
1
vote
2answers
272 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
356 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
257 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
80 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
815 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
42 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
56 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
180 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 ...
0
votes
4answers
3k 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
1k 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 ...
1
vote
1answer
214 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. ...
0
votes
2answers
377 views

compare two directory (each with multiple sub-directory and folder) and find files that are not present in either one of them in windows

I want to compare two directory (including subfolders) for files (for example pictures) in two separate drives. I have thousands of files and are hidden inside subdirectory and folders. Small: ...
1
vote
0answers
200 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
61 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
57 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
46 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
613 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
268 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
260 views

Batch to prompt for folder name and command, redirect to TXT file

What I'm trying to accomplish, is to have the batch file prompt the user to input their specific folder on our team's directory, and then prompt for a specific command to be used, and redirected to a ...
0
votes
1answer
133 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
86 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
109 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
213 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
106 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
257 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
248 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
66 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
129 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
30 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
398 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
221 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
265 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 ...