Text file containing a sequence of commands or program invocations.

learn more… | top users | synonyms (1)

1
vote
1answer
146 views

Compare and replace files using a batch file

Using a batch file you can do fc folder1\* folder2\* Now, I'd like to extend that to support subfolders (assuming it doesn't already, idk), and additionally automatically move the missing files from ...
3
votes
2answers
8k views

Simple windows batch file that will copy a file to a folder, and create a sub-folder with timestamp

I have a file at: c:\source\hello.txt That I want to backup as I modify it often, to here: c:\backups\source\????\hello.txt How can I create such a .bat file to do this? I want the script to ...
2
votes
1answer
111 views

Batch File to Delete a folder if it doesnt contain a specific file

I have a folder with loads of subfolders. I need a batch file that looks down the list of subfolders and checks if a specified file exists. If the file does not exist then the sub folder can be ...
1
vote
1answer
61 views

Passing Env Variables to Batch File

I'm having difficulties passing a env var (declared in my .bash_profile) to a batch file script which executes a BTEQ operation (in Teradata). .bash_profile contains: export DBPASSWORD='password' ...
0
votes
1answer
78 views

How do I get the bytes sent and recieved in taskmanagers networking tab in cmd

How can I see a NIC's bytes received and bytes sent at the Windows command line? I've tried the following: netsh interface ip show ipstats and net statistics workstation but they don't show the ...
0
votes
1answer
44 views

Create a shortcut to a batch file with args [duplicate]

I need to create a shortcut to a batchfile say start.bat, with some arguments. Can I do it like "D:\Jboss\start.bat" arg1 arg2
-1
votes
1answer
133 views

Escaping ampersand (&) in Windows batch script used to map/connect network drives

Using a simple batch file to connect to network drives on Windows start-up but one of the folder names contains an ampersand and I cannot for the life of me, figure out how to escape it. Here is the ...
1
vote
1answer
102 views

How can I make a .bat file run automatically when an alert box pops up?

Sometimes POP Peeper suddenly does not work on my computer. Whenever it happens, an alert box will pop up, and the box's PID in Task Manager is 244. The solution is to restart POP Peeper. I know how ...
0
votes
2answers
70 views

Is it possible to execute batch commands from Windows shortcuts?

I'm trying to run some programs from a flash drive. Therefore, I want them to keep their data on the drive as well. I know how to do this using the following batch script; APPDATA=%CD% Program.exe ...
74
votes
9answers
190k views

How to run a batch file without launching a “command window”?

On Windows XP, can I run a batch (.bat or .cmd) file, via a shortcut, without a "black window"?
2
votes
2answers
107 views

Batch Script To Randomly Rename A Single Selected File

I'm trying to hash out a batch / .bat script that renames a single file to a random string of characters. Everything I have found upon searching so far is to rename all files within a single directory ...
1
vote
1answer
50 views

MS-DOS copy command

Hello this is something that has been on my mind for quite some time. How can you copy just say the first 5 files out of ten with one command. For example: file1.txt file2.txt file3.txt file4.txt ...
1
vote
2answers
172 views

run a batch file from ftp

The title basically says it all. I have done endless hours of research trying to find out how to run a bat file from an FTP. Long story short I have a Bat to shut down a server and I need to be able ...
0
votes
0answers
22 views

split file on first char hex

I need to split a txt file based on first char. I have: gawk "{n=substr($1,0,1); print >> n\".txt\"}" test.txt This outputs a.txt b.txt with corresponding content. I would rather have an ...
0
votes
1answer
118 views

Create batch File to run one time and exit comand prompt window

This is the command line i want to run on my windows xp machine arp -s 192.168.1.1 11-22-33-44-11-22 I tried ti make code like this into arp.bat arp -s 192.168.1.1 11-22-33-44-11-22 exit When i ...
1
vote
1answer
120 views

Reverse scheduled tasks script

I have run the following .cmd file and I do not like it and want to completely reverse the changes. How would I do this without losing the original information about triggers/conditions etc. ? @echo ...
1
vote
2answers
334 views

Batch file to delete files from wildcard folder

How do I create a batch file that deletes files from multiple directories? D:\L1\asdasda\L3\*.txt D:\L1\dfghfghfh\L3\*.txt D:\L1\tyutyugj\L3\*.txt D:\L1\ytrtyrty\L3\*.txt Like: D: del ...
1
vote
4answers
3k views

Delete specifiied files and log all output in CMD

I've written a script for a school I'm working at to automatically mount a folder as drive X: and then to go into drive X and recursively scan all folders and sub folders for .bat, .cmd, .exe and .vbs ...
2
votes
1answer
171 views

Batch file error because of space in input string

I'm trying to make a table of possible inputs for the end user, but one of the inputs is causing the program to crash as there is a space. I know that usually enclosing the input with " " is the ...
0
votes
0answers
23 views

Batch File Won't Load If Sim Is Running

I have a Windows 10 64 bit system which I use for flight simulation in full screen mode. I would like to load additional flight data via a batch file whilst the sim is running. I have assigned a ...
1
vote
1answer
303 views

Creating an account creation script to create new users in Windows Server 2008

I need to be able to make an account creation script that will create a new user in the Domain Users group, set its password, roaming profile, and login script. The input will be first name, last ...
1
vote
1answer
123 views

Batch file to change system date on start up?

Cmos battery dead with wrong time/date cant fix it at the moment In the time being I want a batch file to change the system date and time to current as a start up task But if the date/time is wrong ...
2
votes
1answer
1k views

Batch file to move/compress/delete files

I am trying to write a batch script that will run automatically daily to do the following: Move files older than 2 days to from the main directory (Jason) to an archive directory. Zip files in the ...
2
votes
2answers
13k views

Trying to read a text file content and set variables values from that

I have a batch file that creates a text file with its output like the following: RESULT=0&SECURETOKEN=SmH3kciXiVkiwD0i70CwKYgAR&SECURETOKENID=2013031414280240&RESPMSG=Approved The ...
1
vote
1answer
907 views

Edit files from a batch script

How would I edit a file from a .bat file that changes the contents of a file located somewhere on the hard drive. For example there is a file on my desktop, can I make a .bat script that will add a ...
1
vote
1answer
87 views

Delete all with exceptions from command

I have a folder with about 50 different files in it (NAME1.jpg, NAME2.jpg, NAME3.jpg...). I have a program that runs, and splits each file into about 4 different files and re-names them (NAME1-0.jpg, ...
5
votes
6answers
1k views

Command to find network interface for IP

With ipconfig I can show the list of network adapters and their settings, e.g. the IP address. I'm looking for a reverse command that displays the name of the network adapter for a given IP address. ...
0
votes
1answer
299 views

How can I remove the 'OK' button from a .bat file message box?

echo msgbox "Hey! Here is a message!" > %tmp%\tmp.vbs wscript %tmp%\tmp.vbs del %tmp%\tmp.vbs The above message box will disappear if I press any key. I want the box to go away if I press a key, ...
2
votes
2answers
595 views

Need a Batch toggle that will launch/kill applications when run

I have a great batch toggle that will show hidden files when run, then hide hidden files when run again. I am wondering if I can create a similar file that will kill a series of work applications ...
0
votes
0answers
50 views

Extra space when starting application with arguments using batch?

Any idea why there is an extra space before the argument? Thank you. http://s7.postimg.org/ee1fbtye3/extraspace.png @ECHO OFF SET EXEPATH=D:\Games\StarForge\StarForge.exe SET ARGS=-nolog START "" ...
1
vote
1answer
3k views

Why doesn't the bitsadmin.exe download manager work for me?

Why does this bitsadmin command fail? bitsadmin.exe /transfer myDownloadJob /download /priority normal http://mirror.anl.gov/pub/ubuntu-iso/DVDs/ubuntu/8.04/release/FOOTER.html c:\Temp It seems ...
2
votes
2answers
3k views

Detecting computer name

How can I detect if I am on a certain host computer in a batch script? Ex if I run the command hostname it gives me the current computers hostname. Is there a way that I can save that to a variable or ...
6
votes
3answers
13k views

how can I make my .bat file continue after an error

I have a .bat file in windows that does three things cmd1 arg1 arg2 cmd2 arg3 cmd3 arg4 arg5 arg6 Sometimes cmd1 can fail and that's fine, I would like to carry on and execute cmd2 and cmd3. But ...
0
votes
2answers
718 views

Automate putty via batch and execute a command

I use putty everyday to login to a Linux session and execute some commands. Now since I have a thought to automate this process, I would like some help to complete this process. I have made a batch ...
2
votes
3answers
20k views

Redirect pipe to a variable in Windows batch file

I want to stop and start a Windows service from a remote PC using the Windows command line, in a batch file. sc \\192.168.1.1 stop <ServiceName> rem sc \\192.168.1.1 query <ServiceName> ...
-1
votes
2answers
95 views

Rename Files In A Batch Script

I'm attempting to rename all files in a folder via a batch script but I'm getting an incorrect syntax error that I can't seem to identify: for %%f in (%Source%\*DebugLog.Config) do %%f ren %%f ...
1
vote
4answers
262 views

add “text” to end of multiple filenames

Using the code below I add text to end of file names which are: 1.mp3 2.mp3 and should be: 1text.mp3 2text.mp3 but it changed to: 1.mp3text 2.mp3text Code: @ECHO ON FOR %%A IN ...
22
votes
9answers
114k views

Is it possible to automatically run a batch file as administrator

I am wondering whether it is possible to automatically open a batch file as admin when you double-click on the batch file, because the commands need to be run with administrative rights. Note: I ...
0
votes
0answers
203 views

How do I execute a program on a virtual Desktop using cmd

I am looking for a command that lets me open a program on a Virtual Desktop in Win 10. I need that command for a batchfile I am writing, if you got another workaround (like multiple commands doing ...
2
votes
1answer
59 views

windows 7: how to run a bat when specific program start?

For the moment I'm using a bat which launch the program. But I would like the bat to run automatically when the program launch. I did look into the task scheduler but this option seems to be missing. ...
0
votes
1answer
103 views

Start VirtualBox vm via cmd.exe and hide the cmd.exe window just after

The following command will start a Virtual Box VM in Headless mode: "C:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe" --startvm Slack131 I have it in a .bat file. After double-clicking the .bat ...
0
votes
0answers
50 views

Win Server 2008 r2 - Task Scheduler run groovy script

I have created a Batch-file MyBatchFile.bat with the following content: groovy SomeScript.groovy So in a nutshell: the Batch-file simply runs a Groovy-Script. When I double click the ...
-3
votes
1answer
86 views

How i can make my own DOS(Disk Operating System) distribution? [closed]

So, i am making a batch file OS project in Windows, and i want to make it run under DOS. I want to make my own custom distribution of DOS that i can use as a shell of my project. I tried to find a ...
0
votes
0answers
26 views

Win7 long filename passed into batch file only see short file name

I have a batch file that is called from the context menu , all it does is pass in the file name to the batch file. From the context menu [HKEY_CLASSES_ROOT\*\shell\Label Back Up File\command] ...
2
votes
3answers
15k views

Bat file to open excel with parameters - spaces

I would like to run Excel, open a specific file in it and pass arguments to this file. My call is "C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE" ...
2
votes
1answer
60 views

Batch file to add Java Cryptography Extension files to updated Java

I'm trying to automate the following situation on a Windows 7 workstation. I use Java only for a single vendor app that requires the Java Cryptography Extension files to be placed in \security. ...
6
votes
2answers
33k views

Windows batch file if else usage

Sorry I am new to this stuff. I'd like to run in a certain sequence the same bat file with different parameters. I wrote a very simple batch file: @echo off REM Note: to see all command line usage ...
0
votes
1answer
27 views

ECHOing a variable that contains a string with spaces in a .bat file

I'm pretty much a beginner at .bat files, and I've stumbled across something that has stumped me. set /p msg=Enter message here: echo %msg%>>"D:\\File_location" And then a second file would ...
11
votes
5answers
2k views

How can I create a list of named folders in Windows automatically?

So, I am studying an online course which has hundreds of sub lectures. I need to download the source code for each lecture in a corresponding sub-folder. With over 120 lectures, creating a sub-folder ...
0
votes
0answers
19 views

Python scheduler using bat file

I have got a pyhton script for reading a csv file from a server, extracts one line and send an email with the extracted line. But I would like to run the scipt every 20 minutes which is the time step ...