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

learn more… | top users | synonyms (1)

1
vote
2answers
112 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
228 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
117 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
279 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
307 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
67 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
137 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
34 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
428 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
265 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
302 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
68 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, ...
1
vote
1answer
352 views

Problems elevating permissions while running a batch (CMD) file

I’ve put together a batch (CMD) file that we use to check various things on select servers. What is posted below is almost everything (minus sensitive info). If launched with the proper command ...
1
vote
3answers
557 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. ...
2
votes
1answer
123 views

Unbalanced Parenthesis in a for loop in batch

@echo off FOR /l %%A in (0,1,30) do ( set /a results=1600 + !RANDOM! %% (1900 - 1600 + 1)echo %%A--!results! ) When I run this I keep getting error "Unbalanced parenthesis" in windows xp and when I ...
0
votes
1answer
78 views

%RANDOM% environment variable is giving a single number [duplicate]

I’m having trouble with the %RANDOM% environment variable in the following command: FOR /l %%A in (0,1,30) do set /a results=1600 + %RANDOM% %% (1900 - 1600 + 1) && echo %%A--!results! I ...
0
votes
2answers
254 views

MS Dos Batch rename options

I have some files like: f0110_01_online.png f0122_01_01_online.png f0122_0201_online.png There is common text '_online' in every filename. I just want to remove '_online' from every filenaeme ...
0
votes
1answer
27 views

How to delete contains of a folder with out deleting the folder remotely..?

I don't have AD access, but i have C$ access. There is folder name icon in every profile n almost every system in the domain. I like to delete it. THIS IS THE PATH ...
0
votes
1answer
60 views

How can I automatically delete the MP4 version of a file if an MKV version exists?

My upstream host has changed the way they send video files and I now have dozens of folders that contain both an MP4 and an MKV version of the same file. I want to keep the higher quality MKV file and ...
0
votes
1answer
348 views

How to prevent programs from closing after batch file is executed?

So I have created a batch file that will run upon start-up that is made to run some programs automatically. The programs will all start and run fine, but after the batch file has finished all the ...
0
votes
0answers
182 views

whats a good way to format event log (wevtutil) results?

wevtutil qe Application /rd:true /c:10 /f:text this returns the following (partial): Event[7]: Log Name: Application Source: SceCli Date: 2013-11-14T04:13:03.000 Event ID: 1202 Task: N/A ...
1
vote
1answer
194 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 ...
1
vote
1answer
2k views

Internet Explorer 8 “Run with different credentials” shortcut - batch script option?

Internet Explorer 8, combined with Windows 7, offer the possibility to open IE by specifying which user account will be used for security. This can be done by shift right clicking the IE shortcut and ...
1
vote
0answers
171 views

How can I modify the BAT file in this post so it will randomly select 1 background contained in a folder containing multiple backgrounds?

Is there a way to modify the bat file from this post here: How do I set the desktop background on Windows from a script? so that it will randomly select 1 background image from a folder containing ...
1
vote
2answers
1k views

Delete all files older than 365 days, but exclude certain folders

Edit: After @Mbu answer I realized that my first approach with leading numbers in folders as criteria to exclude isn't the right way. I decided to use a fixed list of folders to exclude. I want to ...
2
votes
2answers
67 views

Trying to hide this text that shows up after “pause” in cmd

This text "Press any key to continue", I don't want this to show up, is there a way I could hide this part of the text but I also want the previous to stay, thus the pause command.
3
votes
3answers
2k views

What does the percent sign (% and %%) in a batch file argument mean?

I think I'm missing something because I can't seem to find what this means. Example: for /D %%A in (*) do "\7za.exe" u -t7z -m9=LZMA2 "%%A.7z" "%%A" That line was supposed to use a command line ...
0
votes
0answers
67 views

How can I get the Windows command line to ignore the “set” reserved word?

I'm running an IIS command on a remote server via PSEXEC. the command I'm running has the "set" keyword, which is a command-line reserved keyword. My command looks like this and throws an error. ...
0
votes
2answers
82 views

.bat file overriding answer

When I made this batch file, when typing y and n for the first time it works fine, but as soon as I choose n, every single time I try inputting something, it opens up the 7000 songs wpl list then ...
0
votes
2answers
175 views

Batch file to create many files with special characters

Essential info: I have a file "DB_OUTPUT.TXT" with 304 lines that I need to turn into 304 files (one per line). Each line contains many special characters and may be up to tens of thousands of ...
0
votes
2answers
1k views

Batch IF .exe is not running

I am trying to create a batch that IF program.exe is not running in process, it will run code below. In vb.net this is easy, but I do not want to create a program. I am guessing a VBS script would ...
0
votes
2answers
423 views

how to use sleep command for parallel running of batch files

Sorry for this painful dumb question . I have 2 batch files where i have some commands to execute in batchfile1 and sleep for some time and then execute somecommands in batchfile2 and again batchfile2 ...
1
vote
2answers
586 views

Batch script to remove # from a file name (only in a specific directory)

I'm looking for a script to remove the # character out of any file names in a specific directory (PDF documents). I've been looking at some similar examples, but it's all a bit confusing!
0
votes
1answer
116 views

Is Clonezilla a good option for a daily batch-file-based backup of a Windows XP PC?

Having just been through the process of rebuilding a Windows XP desktop machine when the disk died, I'm anxious to make it a lot less painful. I didn't lose any data, but reinstalling everything took ...
0
votes
0answers
25 views

Is there a way to create a script/BAT that changes my desktop image… if so how? [duplicate]

Okay so I just got this program that lets me lock my PC screen (this info doesn't matter much) anyways... You can run files when the program starts/locks and closes/unlocks. What I would like to do is ...
0
votes
2answers
66 views

Batch-Script for copying and overwritting existing files

So I've got a file called modified.txt, however the same file is in a bazillion folders and subfolders. I want to copy the modified.txt to all these bazillion folders and subfolders and overwritte ...
0
votes
2answers
150 views

How put path changing .bat file inside %PATH%?

I have a problem described here (you can read it for better understanding). I need to write .bat file that change path. For example: While sending a command in cmd: cd ~ I want to go to %HOMEPATH%. ...
0
votes
0answers
10 views

Batchfile Cypher to Word

I am looking for that movie effect in a batch file, where there are numbers and letters flashing, and they eventually land on the right letter and form a word. Would anyone know how to do that?
0
votes
1answer
254 views

TotalCommander: a button to run a batch script?

could anyone give me a hint how to configure a TotalCommader UI panel button to run a batch file residing at some location, say C:\scripts\batch.bat? I literally need contents of button config ...
0
votes
0answers
115 views

Batch file console window close?

I have a batch file which executes a PLink command and accepts ssl certificate on Linux server. When I run this code, console window appears and accepts the ssl but is unable to close console window ...
2
votes
2answers
221 views

Ansicon vs. Batch File

I am attempting to make a colored command prompt in Windows 7. Using ansicon, I have successfully managed to create the prompt. However, when I put the commands into a batch file, I receive an ...
-1
votes
2answers
384 views

Avoid running multiple instances of a batch file

I'm running Selenium using Maven through a .bat file from my desktop. Now, when I click for the first time, it runs. How can I avoid it to run when I click again? For example, it should show some ...
1
vote
0answers
91 views

How do I add in a shortcut on the shutdown menu to a program?

I would like to add a shortcut to this menu here: Does anyone know how to accomplish this? I have Windows 7 Home Premium 64-bit SP1 (6.1, Build 7601)
0
votes
2answers
694 views

Create .bat file to deactivate device [duplicate]

I'm not familiar with creating .bat files, but I want to create a file to deactivate/disable a network device This is in win7. I have googled some similar problems, but nothing to solve this. pls ...
0
votes
2answers
262 views

Find all .mp3 and move to specified directory using batch

How would I change this to find .mp3 and move to specified directory? @echo off set extlist=mkv mp4 mp3 set rootfolder="C:\Users\Fred\Downloads\uTorrent\Downloads\Complete" pushd %rootfolder% if not ...
1
vote
1answer
346 views

For Windows systems, will “.bat” or “.cmd” extension make any difference for my script?

Assuming that my shell script is entirely based on DOS commands(dir, cd, etc and not VBS or PowerShell commands), using .cmd or .bat extension for it's name will change something? I mean, it will be ...
-1
votes
1answer
127 views

Batch or VBscirpt to copy only folder structure(Not Files) from one server to another server by giving folder structure as an separate input file

Example: Source: Server 1: C:\Folder1\Test2 C:\Folder2\Test3 C:\Folder3\Test1 Destination: Server 2: (Same structure above should be copied here with permissions) Note: In script, have to call the ...
1
vote
1answer
89 views

BATCH SET unable to use divide operator

I am unable to divide using the divide operator provided in the SET command. SET /A 216/18 SET /A div=216/18 ECHO %div% Though this should work and it does in the command prompt window ...
1
vote
2answers
6k views

How do I get a .bat file to run in Task Scheduler at PC Startup?

Alright so I have been reading through the various answers on Super User for this question and no one has seemed to actually post a way of running a .bat file in Task Scheduler at PC startup. I would ...
2
votes
1answer
98 views

Which program should a batch script with extension .bat be associated with in XP sp2?

For some reason or other my .bat files are associated with notepad and will therefore not run. Looking for answers, I have only found solutions for systems other that XP. Assistance would be greatly ...