Text file containing a sequence of commands or program invocations.

learn more… | top users | synonyms (1)

1
vote
2answers
248 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
153 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
291 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
104 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
904 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
76 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
252 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
590 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
505 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
19k 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
93 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
191 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
110k 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
190 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
57 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
91 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
47 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
77 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
54 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
25 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 ...
2
votes
2answers
53 views

Executing a command line command from a simple batch file?

I am very new to this so a simplified explanation would be appreciated. I am trying to make a batch file that executes the following command in the command prompt: C:\Users\delta\dc2.exe ...
2
votes
1answer
1k views

How can I move files into a folder based on their name?

I have several .pdf and .tex-files in a certain folder "ABC". They all are named by the scheme C01S02_Word.pdf C03S02SS01_Description_random_words.pdf C04S01SS02_More_words.pdf and so forth C in ...
2
votes
4answers
3k views

CMD keep running program

This isn't very googleable, and other than writing prog.exe -params several times in a batch file (which would obviously only work as many times as I wrote it) I can't think how to repeatedly do this. ...
0
votes
0answers
13 views

Change default program for Edit context menu [duplicate]

Using Windows 8.1 here. Something that was simple in Windows XP is frustratingly complicated in Windows 8.1...arggh! I'm trying to change the default action when I select "Edit" from the context menu ...
2
votes
1answer
152 views

How to open multiple MP3 files with batch or vbs, just like Ctrl+A Enter

Just like the title suggests, I want to make a batch or vbs script file that will start playing music from my music folder. I can't make playlist because I'm updating this folder very often, and I ...
27
votes
5answers
62k views

How do I delete directory trees via batch file on Windows 7?

I want to delete the whole content of a specified folder on Windows 7 via batch file. My problem is, that 'del' or 'erase' only deletes the files, not the folders and 'rmdir' or 'rd' always deletes ...
5
votes
3answers
4k 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 ...
0
votes
0answers
17 views

Windows clipboard to command line

I'm trying to make a script that copies text with a simple macro and have a running .bat file extract the text from clipboard and set it as for instance var1. set /a var1=|clip| The above code was ...
0
votes
1answer
69 views

HOW can i make an html page with bat file?

I am trying to make an HTML file with batch file. But it didn't work. How can I make that? my bat commands set/p n=1: copy con c:\55.HTML my HTML page %n% but this commands just makes a 55.HTML ...
15
votes
3answers
7k views

How to extract a complete list of extension types within a directory?

Within a directory, and recursively within it's sub-directories, meaning every directory within a directory is processed, how do I compile a complete list of unique extensions within the directory? ...
1
vote
0answers
32 views

Reliably resolve location of a batch file

A standard construct to get the directory of a batch file is to use %~dp0. However, this returns the wrong directory if the batch file's name is in double quotes. For example, npm generates cmd ...
1
vote
2answers
332 views

Using msiexec to uninstall programs

I have found a batch file that removes a lot of bloatware etc. Example: start /wait MsiExec.exe /I{DB731A07-34DE-4BE0-AE94-45C83E28A56C} /quiet I guess the {DB731A07-34DE-4BE0-AE94-45C83E28A56C} ...
0
votes
1answer
29 views

Batch file to move contents of a folder with Subfolders to same structure on Partition drive

I am wondering how to create a .bat file to move all files within a folder containing subfolders to an identical setup on a different volume. For example, Folder called Support with Subfolders ...
0
votes
0answers
43 views

Using wildcards in the name string within batch file

I have following script to retrieve client information from DNS: @echo off CLS for /l %%a in (15,-1,1) do ( color 9f cls ) @echo off set /p tool="Please Enter Desired Name In The Following Format: ...
0
votes
2answers
27 views

Variable wont work when made in IF batch program

I am trying to make a game, and whenever I try it, it says there is a syntax error when it is right :Q3 echo ==================================== echo Do you want to be skilled in: echo. echo Speed ...
-1
votes
1answer
48 views

Batch file to clear CSC

Need help with a batch file to clear CSC. I found a way how to by REG ADD "HKLM\System\CurrentControlSet\Services\CSC\Parameters" /v FormatDatabase /t REG_DWORD /d 1 /f Is there way to way to do ...