Text file containing a sequence of commands or program invocations.

learn more… | top users | synonyms (1)

1
vote
2answers
98 views

What is a Win 7 compatible command to change the name of a window started from the “start” command?

My team has just migrated to Win 7. We have a batch file that is no longer working. Here is the line that has a problem. start "NameOfWindow" /DSomeDirWeWantCWD ..\SomeDir\SomeNameOfAnEXE m Under ...
6
votes
1answer
98 views

something strange about Win-XP's command shell

I wrote the following command in windows XP's command shell and something strange happened: C:\Folder1> copy sample.txt : Because of my typing mistake, I wrote ":" instead of "D:" ... but it ...
0
votes
1answer
1k views

FORFILES not deleting files in subdirectory

Below is my forfiles one-liner: FORFILES /P "X:\LOGS\HS" /S /M *.log /D -1 /C "CMD /C del /Q @FILE"qq ~q Although I have the /S option to delete log files in X:\LOGS\HS, there are several ...
1
vote
2answers
1k views

Running Batch File As An Administrator…

I successfully created a batch file to flush my DNS. I have added a pause, I noticed in the title bar of the console window… It's not running as administrator. I've already tried a couple of ...
-1
votes
1answer
38 views

How to download the latest version of software from a site using a script?

For example: How to download the latest Google chrome from their site using a Bach file or any kind of scripting language (python,ruby etc)? its the concept i am looking for. Any help will be ...
1
vote
1answer
1k views

Batch copy multiple folders and their subfolders into a merge folder

I have a folder X:\Export that has several folders: X:\Export +---Export1 | \---various files … +---Export2 | \---… and subfolders +---Export3 | \---etc. \---etc. (names vary ...
3
votes
1answer
5k views

Connect to VPN using command line results in error 691

I've wrote a simple batch file to connect to a specific VPN connection using RASDIAL rasdial MyVPNConnection but it always returned the error 691 Access denied because username and/or ...
0
votes
1answer
666 views

How do I uninstall software that has 2 uninstall strings using batch file?

Can someone please offer any advice on how to uninstall the below two strings at the same time using a batch file? MsiExec.exe /i{5577B8F7-A4A8-451E-BDE1-471E52825904} "C:\Program ...
2
votes
2answers
1k views

How to Automate .inf PnP Windows 7 Drivers with Wildcard?

I am trying to automate the PnP driver installs for Windows 7 with either of the below batch files via For loop and wildcard for the .inf file. The rundll32 batch reads and echos the correct .inf ...
2
votes
1answer
440 views

.Bat File to Change Wifi Connection to Public Connection [closed]

I need to create a .bat file that will set a wireless connection, eg MyNetworkName, to a public network, so it won't be on Home or Work. I have searched and I don't know how to do this.
1
vote
1answer
671 views

What would prevent a .BAT file from being run on a mapped drive?

In WinXP SP3, I have a .BAT file on a mapped drive. When I try to run this .BAT file (or even right click->edit) it gives me: --------------------------- Windows cannot access the specified device, ...
5
votes
1answer
4k views

Remove registry keys using reg.exe in a batch script

I've written this little batch script to help me auto-clean the registries of 300+ identical PC's of some very specific registry keys. It works right up to the point of passing the key variable to ...
2
votes
0answers
736 views

Command line switching

I have read through some suggestions but I am just not technical enough to get this I think. I am a CAD designer and each file has 5 files associated with it. I have 3 sets of 5 files, and each set ...
4
votes
2answers
2k views

Selectively deleting system scheduled tasks

Windows 7 box has a list of scheduled tasks - > Default Windows tasks + Certain custom tasks that all start with a certain string. Previous code deleted all tasks with the command: schtasks /Delete ...
37
votes
3answers
40k views

How does the Windows RENAME command interpret wildcards?

How does the Windows RENAME (REN) command interpret wildcards? The built in HELP facility is of no help - it doesn't address wildcards at all. The Microsoft technet XP online help isn't much better. ...
2
votes
2answers
6k views

How do I copy recent folder/files from a network drive using a batch file?

My question may have answered someway or other but unfortunately I did not get the exact answer that I was looking for. Here is what I'm trying to do- create a folder on pc1, c:\temp1 map a network ...
0
votes
0answers
764 views

Login .bat script in Windows XP user to run with admin rights

if exist C:\Windows\System32\CCM\CcmExec.exe ( net use /del Z: ) else ( net use z: \\c-svsccm01\SMS_CMB\Client start /d "Z:\" CCMSetup.exe ) This is a .bat file I created to run a .exe ...
0
votes
1answer
410 views

CMD-file and task scheduler

I want to run CMD-file, as described here. I set run file every 5 minutes in the task scheduler. But when the scheduler runs the file - the window flashing. How to run CMD-file in background mode? ...
5
votes
1answer
8k views

Batch convert *.avi files using ffmpeg

I am trying to convert 20+ .avi files in a batch using ffmpeg. I've got the following @echo off. for file in *.avi do ffmpeg -i "$file" -s 640x480 -vcodec msmpeg4v2 "'basename "$file" ...
6
votes
3answers
6k views

How to sign a Windows batch (.bat) file?

I'm running Windows 7 and when I try to run a batch file, it says, "The publisher could not be verified. Are you sure you want to run this software?" So when I try to sign it with my code signing ...
0
votes
3answers
669 views

Variable set in batch file not being read

I have a text file with the following values datasource=c:\temp\datasource Which I am then attempting to read from a batch file and populating a for loop. for /f "tokens=1,2 delims==" %%b in ...
1
vote
1answer
130 views

How can I only have a single move command in a batch file?

I have an existing batch file that attempts to move files from 2 directories to 2 different locations. At the moment these are called as 2 separate move commands. I am wanting to simply the code ...
0
votes
1answer
718 views

For loop in batch file not moving file

I am looping through a particular directory and if a zip file or files exist they are moved to a secondary folder in that directory however the code below doesn't seem to work i.e. it doesn't move the ...
1
vote
2answers
4k views

Why use start over call when using batch files?

It appears that I can use either start or call to execute batch files however am unsure why you would use one over the other. What are the benefits?
1
vote
2answers
844 views

Filter a CSV file using Windows batch file

I have a file with 12 columns separated by ? I need to export column number 12 (NetBIOS Name) and append the whole row to a CSV file. Skip the first line that is the column description. The first 4 ...
3
votes
2answers
9k views

Run a program in a batch script and wait for it to finish before continuing

I have a very specific requirement. I am attempting to upload files via sftp which uses private keys. I already have a bat file that connects to the host and uploads the file however I need to move ...
3
votes
1answer
707 views

Batch file infection command explanation

I do know that commands below is used to infect executable files. But I don't know how they work exactly. Can somebody explain this to me? @echo off Dir %Homedrive% /s /b > DirPath For /f %%Y In ...
2
votes
3answers
6k views

How to start executables through command prompt with space named files and without command prompt waiting program to close?

I would like to create shortcuts to some executable files (exe, bat, com...) on Windows 7 using bat files, but I had some troubles with that: start notepad.exeworks perfectly, but start Foxit ...
5
votes
1answer
902 views

How can I launch batch files from another batch file while piping their output and retaining the current working directory?

I have a batch file which runs as a scheduled task. For the sake of example lets call it alltasks.bat. It looks like the following: @ECHO OFF clearwebtemp.bat > clearwebtemp_out.txt ...
1
vote
0answers
2k views

How come adding desktop icon with shortcut.exe no longer works?

Here's the code from a batch file: @echo off rem add desktop icon "C:\Program Files\shortcut.exe" /f:"%userprofile%\desktop\Knowledge NoteBook.lnk" /a:c /t:"C:\Program Files\Internet ...
0
votes
3answers
5k views

Override mapped drive name using .bat script?

I have the following batch script which is successfully mapping a few of our drives for our users: @echo off net use * /delete /yes net use x: \\192.168.1.52\xrays net use s: \\192.168.1.52\common ...
1
vote
1answer
384 views

How to use the current date as an argument?

I have a batch script which extract SQL data to CSV file: bcp Database.dbo.MyTable out C:\Reports\Output.csv -s ServerName -T -c I need the name of the output file to contain the current date. For ...
1
vote
2answers
261 views

Calling .bat from bash terminates loop

I'm having a problem that is extremely odd to me. I have a loop that reads a file line by line that looks something like this: while read line; do echo "Beginning of loop" ## Call to function ...
0
votes
1answer
208 views

Change volume with Dell Latitude point stick buttons

I have a dell Latitude with point stick and buttons that I never use. The keyboard also does not have volume controls, even via the function key. What I want to do is map the three point stick buttons ...
1
vote
1answer
2k views

How to determine the current directory in a batch file

How can I determine the current directory in a batch file. Other than %~dp0. So that when I run the batch file from source folder (consisting of my files) it returns the path of source folder, where ...
0
votes
1answer
179 views

Start EXEs from bat file

In the command line I can easily write start my.exe however when I do that in a bat file and execute it I get a cmd window called my.exe. How do I start exe's and shortcuts from a bat file? The bat ...
1
vote
1answer
3k views

Batch file equivalent in Linux

I have a few basic commands that I need to run on a Red Hat Linux 5 Virtual Machine with GNOME to start a couple servers. Example cd /home/user/scripts sh runTHISthing.sh pub cd /home/user/logs ...
4
votes
1answer
992 views

Batch File To Detect And Set Windows 7 Power Mode

I would like to create a batch file that checks the current system power mode and change it if necessary. I have the following. What am I doing wrong? (it does not work) @ECHO OFF SET ...
4
votes
1answer
3k views

How can I retrieve input from the user in a .bat file?

I'm the using the command dir /AD /B "\\computerName\users\" >> user_export.log Is it possible to create a batch file that asks the user to enter the Computer Name and then when the end user ...
1
vote
1answer
798 views

A batch script for creating a folder for each file

It might be a duplicate of this but I need a little revision: Creating a folder from first 5 characters of filename in a batch file I don't need to select the first five letters of the file. I want ...
2
votes
1answer
175 views

Can I prompt a user to save a file using windows explorer?

I'm trying to build a windows batch file that will copy a folder and all its contents from the local user directory into an individually named folder on a shared server. The name of the folder on the ...
1
vote
1answer
320 views

If I wanted to use a batch file to restart 3 programs how would I do that?

I want to create a batch file that when ran it will exit 3 separate applications, wait a few seconds and then relaunch the same applications. Can someone assist me with some resources for ...
0
votes
1answer
848 views

Rasdial error 756 only solved by rebooting

I have a very frustrating issue with a VPN connection initiated with Rasdial. I have computers (Windows XP Professional SP2) which serve as an unmanned field measuring devices. They automatically ...
0
votes
4answers
1k views

Writing scipt to open multiple applications with a username/password

Is there a way to write and run a script that will enable me to: Run an app with a username/password Have that script carry out a few simple shortcut commands (ie connecting to and receiving from ...
0
votes
2answers
971 views

Run batch file on startup NOT LOGON

I want to run a batch file that maps a network drive but all of the solutions I have found run the script in the start-up folder which isn't really what it says it is. How do I map the drive BEFORE ...
2
votes
1answer
6k views

Windows 7 batch files: How to write string to text file without carriage return AND trailing space?

I am trying to have my batch file write a string of text to a text file. At first, the command I was using was writing an extra carriage return to the end of the string, but I found this command that ...
0
votes
2answers
1k views

Checking if a remote Tomcat server is running from Windows?

I am using Windows 7, and I have a remote Linux machine that runs a Java application in Tomcat (on port 8080). Sometimes, the remote machine is up but Tomcat doesn't respond. How can I code something ...
0
votes
2answers
607 views

Copying a folder into multiple folders

I have a folder with some content which I want to copy into 260 folders. I guess this is doable with a bat-file and a for-loop, but I can't seem to understand how to do it. Anyone keen to help? :)
17
votes
4answers
49k views

Remove USB device from command line

I'm constructing a backup script for Windows 7, and the last action I want it to perform is to safely "remove" the USB drive that it is backing up to. I am under the impression that plugging the drive ...
2
votes
1answer
11k views

How can I read a comma delimited text file in a Windows batch file?

I can get it to read the text file until it becomes a comma delimited text file. I would like to read the two variables on each line and test each one with a If statement for another condition. ...