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

learn more… | top users | synonyms (1)

-3
votes
1answer
27 views

How can I get a win 7 batch file to output a list of unique filename prefixes?

I have the following files in a folder MyDocuments 2014-10-10.zip MyDocuments 2014-10-09.zip MyPictures 2014-10-10.zip MyPictures 2014-10-09.zip Ideally I would like the output to show MyDocuments ...
0
votes
1answer
20 views

how to run a batch recursively

I have a parent folder (BIG_Folder), which contains many subfoldes (folder1, folder2, folder3 ...) in each subfolder a batch file exists, it is always the same (x.bat). I want to run all bats, ...
0
votes
1answer
3k views

How to send mail from a Windows batch file

I want to send a mail from a Windows batch file. Here is my code: blat test.log -server smtp.gmx.com -to dest@gmail.com -f address@gmail.com -s "test mail" -u "address@gmail.com" -pw "password" ...
6
votes
5answers
11k 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 ...
34
votes
3answers
31k 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. ...
0
votes
2answers
43 views

How to set a variable in DOS batch file?

How to display only the status of ping results and not the whole output of ping? ** My server1 is .... online ** My server2 is .... online ** My server3 is .... offline I tried to this with the ...
-3
votes
1answer
28 views

How to search a string and extract another string pattern from a text file using windows batch script

Consider out.txt file have the following format Display Variable; ID NAME value ===*==========*================ 201 Variavle 07Dec2014 Display Variable12; ID NAME value ...
1
vote
1answer
25 views

How fix when cmd prints command instead of run it?

I am trying to automate chef setup for windows. So I wrote .bat according to this: call winrm quickconfig -q call winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"} call winrm set winrm/config ...
0
votes
0answers
27 views

How can i convert .xls to .csv when change is made on csv file automatically? [on hold]

How can i batch convert A.Xls to A.Csv When change is made in A.xls, for example when add 1 record in to A.xls Thanks
0
votes
1answer
23 views

Batch file to search for a file, then delete that and the parent folder

Basically I need to search the folders within C:\Windows\ccmcache and search for adobe cc.msi and then delete the entire contents of that directory This is what I already have @echo off set ...
0
votes
0answers
8 views

Upload a file to ftp/another Web server with batch

I need to upload a file using batch commands. I can either upload it to an ftp server or another form of Web server (hfs)
1
vote
2answers
2k views

Looking to create a batch file capable of editing a line (or word) in a text file

I have a text file (...\config.txt) containing 2 lines which looks like: Preamp: -4 dB Include: surround.txt I need to change "surround" to "headphones" in that config file. I really need to make 2 ...
0
votes
1answer
36 views

Find IP with Batch

I need to use a command of some sort to find the external ip of the user of my batch file. I have tried many methods but I need the batch file to recognise the ip as a variable of some sort so it can ...
2
votes
3answers
2k views

How to set to a variable, the result of a expression

I need to extract the date of a file, for then use this string as part of the name of a new file. I trying to solve this using the next commands: First I get the details of the file and redirect the ...
2
votes
1answer
2k views

Install a Teamviewer host silently with custom password

Our company has the custom Teamviewer hosts that we can run silently with the /S switch. The issue is that we can't connect due to it not setting a password that we know. Does anyone have any thoughts ...
1
vote
3answers
6k views

How to optionally copy and rename a file in Windows?

Basically, in an automated batch file, I want to copy and rename a file if the destination file is missing or older. There are several variants, which do not quite work: copy /Y c:\source\a.file ...
0
votes
4answers
3k views

Run Windows batch files at startup or when any user logs on

I have a server access where I want some batch files to run automatically for any user at startup. The problem is: Other users are unable to run this file and it is required to be run as the user ...
0
votes
3answers
2k views

Minimize a program's windows after running it via .bat/.cmd

I'm trying to find a way to auto-minimize a program just after running it from a .bat file. I'm launching a SSH session via putty, and I'd like putty to auto-minimize. I use it just for the SSH ...
-2
votes
0answers
16 views

Windows Batch script, how do i return only the last item in a list variable? [closed]

In short I need to pick the last item from a list variable, not knowing how many items the variable contains. If my list variable has 4 items, i need the 4th, if it later that day has 5 items, i need ...
0
votes
2answers
50 views

Using cmd to edit reg keys?

I need to edit 2 registry keys in Windows 8.1 but make it in a way to be able to use them in a batch file to be able to use them on more than 1 PC. In the batch file I will have more reg key's that ...
0
votes
3answers
3k views

run 'net user' command as administrator

I was writing a simple batch file with the following command net user Abhi * where Abhi is my username and I am the administrator of my computer. On execution, it prompts for a password and then ...
7
votes
5answers
11k views

Delete all files from a folder and its sub folders

I want to remove all files from a folder structure, so I'm left with an empty folder structure. Can this be achieved in either batch or VBScript scripting? I have tried a very basic batch command, ...
1
vote
2answers
2k views

How to input YES in a batch file automatically?

I am uninstalling Citrix client using a batch file. The batch initiates the uninstall successfuly, but I need to input YES (for confirmation) automatically. How can I do this in the batch file?
0
votes
1answer
21 views

How to rename a file to include remote machine's hostname via batch script?

I have a .bat file that copies a file from one computer to another. During the transfer I would like to rename the file to include the hostname of the computer from which the file originated. The ...
0
votes
0answers
17 views

Batch conditions and variable

I have a question about variable and batch windows. The main goal is : I have files in directory (pattern 0? with ? a number between 0 and 9). First I create a %%nf.bat (filename of each files) ...
0
votes
2answers
2k views

Cut a part from a filename (windows batch)

I got files named like this: cam1(word1 word2 wordN) (24-04-2012 00-11-13).mpg cam2(word1 word2 wordN) (24-04-2012 00-11-13).mpg cam3(word1 word2 wordN) (24-04-2012 00-11-13).mpg Need to cut (word1 ...
0
votes
1answer
20 views

Batch File Gives Message: “1 was unexpected at this time”

I wrote a batch file that checks if a server is online. It uses a few cygwin-64 tools. Here's the batch file: wget -S http://www.example.com/ -o headers.txt -O index.html cat http-commands.txt | ...
1
vote
1answer
3k views

Batch file to install TotalCommander without User intervention

I am new to windows batch file. Here is my first attempt in batch file. Here is my requirement: I should have batch file. When executes, it should read the XML config file for the software list to be ...
1
vote
2answers
4k views

Upload folder with cURL and FTP using Batch file on Windows?

I am trying to upload a whole folder, including it's sub-folders and files to a folder on my server from a Windows batch (.bat) file. Below is the command I have for the Upload part... curl -T ...
3
votes
2answers
171 views

The Directory name is too long in batch

I already asked the question in stack overflow, but did not get any answer from anyone. So i am asking the same question here also. I am trying make a program which will calculate size of all folder ...
-1
votes
3answers
145 views

How to run a .bat file silently and automatically

How am I going to run a .bat file in silent/background? And what command should I add to run a .bat file automatically, wherein every time I'm going to turn on my PC everyday the .bat file will ...
1
vote
1answer
169 views

Batch - call another batch and have it executed

I am trying to get some batch files working. The first one I have (which works) takes a .rar from one drive to another and give the dir same name as the files put to rar and then copy a rename.bat ...
0
votes
4answers
2k views

.Bat xcopy - special characters

this is the code of my .bat file: @echo off xcopy "C:\Users\Administrator\věc" "C:\věc" /e /i /h echo Done pause However it says:File not found - výc. See ě char changed into ý Why is it so? ...
1
vote
1answer
31 views

VLC Command Line Flag --loop from Batch File Not Working

I used to have a batch file that started a playlist in VLC, set to loop indefinitely. Now though, I'm not sure if I have messed it up at some point or a new version of VLC has rendered it obsolete, ...
0
votes
0answers
12 views

Add timestamp to file names

On a server running Windows Server 2008 R2, I would like to rename a number of files matching this quasi regexp: "\d+.\d+.\d+_FOO-\d+.xml". Each new file should contain current time "hhmmss" as shown ...
0
votes
2answers
3k views

Can I put comments in a sftp batch file script?

I'm using sftp batch scripts to automate some file transfers. Is there a syntax for putting comments in the batch files? For example: sftp -b mybatchscript.sftp nick@server Where ...
1
vote
0answers
6k views

Run a batch file on a remote computer as administrator

I am trying to run a batch file (to install some software) on a remote computer. To do this, I am using PSExec. psexec.exe \\COMPUTER C:\swsetup\install.bat This works fine, apart from some of ...
2
votes
2answers
799 views

Start MySQL from the command line without losing prompt

I'm on Windows 7. I'm trying to run a .bat file where I stop and start MySQL and run some other commands. However, running "C:\Program Files (x86)\EasyPHP\binaries\mysql\bin\mysqld.exe" results in ...
0
votes
2answers
18 views

Output redirection at the beginning of line

I'm used to specify output redirection on the end of the line like: echo blah > output.txt Both in Windows and *nix. Recently I'm seeing more and more examples that redirect at the beginning of ...
3
votes
1answer
61 views

How to make ConEmu attach on start

I have an existing .bat file which uses the start command to launch multiple tasks, e.g.: start cmd.exe /k "echo task 1" start cmd.exe /k "echo task 2" start cmd.exe /k "echo task 3" What happens ...
1
vote
1answer
36 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} ...
1
vote
1answer
46 views

WMIC - how to check if return empty value?

I'm making a batch file to make log of computer (I need save some informations before format PC's on my work...) So I found some commands to create this log, see: rem -- Windows Version wmic OS get ...
1
vote
1answer
586 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, ...
0
votes
1answer
25 views

Prevent ConEMU from closing tab after last program exits

What I want is some way to click on ANY batch file from Explorer and see the output without writing a helper script to PAUSE it afterwards. This is a question which seems likely to generate more OT ...
0
votes
1answer
28 views

“START /W” with additional switches

I am trying to run a silent install of several exe's via a batch file, however need them to run one by one instead of simultaneously. It seems like "START /W" wont work when switches not native to it ...
2
votes
3answers
2k views

In windows xp, how can I set the default browser from chrome to IE via Command Line, without admin privs

Situation: 1. Need to Set the defualt browser to IE via cmd(problem) 2. Need to do a citrix login via IE(amounts to loading a url) beause it wont run in google chrome 3. then set default ...
0
votes
2answers
3k views

/ was unexpected at this time

I am getting "/ was unexpected at this time." while using the below for loop for some cases only. for /f "tokens=1,* delims=;" %%m in (file.txt) do ( echo Inside Loop echo %%m ) I'm ...
0
votes
1answer
268 views

Using SETX to configure a pc's LM_LICENSE_FILE environment variable

Various Windows applications such as Matlab, Altair, Nastran etc use license servers, which require a system environment variable - LM_LICENSE_FILE, to be updated which would take a value along the ...
0
votes
1answer
39 views

Finding Files by wildcard name and copy them

I've got a program that compiles itself and generated .exe files in its subdirectories (such as release_win_* directories for every application "App1", "App2", etc.). I'd like to find specific these ...
0
votes
1answer
28 views

Batch Move using wildcard in filename is getting files that do not match parameters:

I have a number of files with a 3 digit prefix. I'm attempting to move files based on the prefix using a wildcard. I expect that move 100*.sql subdir would only move files with the .sql extension ...