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

learn more… | top users | synonyms (1)

0
votes
0answers
7 views

Prefix commands in batch

I am using a batch file to run Grunt with some console customization. I was wondering if there is a way to add grunt and a space to the commands I enter into the console. Here is my batch file: CD ...
0
votes
1answer
43 views

How to start a cmd window and issue tail request in a bat file?

I can open a cmd window and start a tail by entering something like this: tail -f C:\Oracle\WebCenter\Sites\11gR1\Sites\11.1.1.6.1\logs\sites.log This is probably a stupid question, but how do I do ...
-2
votes
0answers
19 views

How to disable internet access for another PC

I want to disable the internet for my little brother after 6:30 PM to improve his grade. I found that I can schedule a task and run this script: netsh interface set interface "Ethernet" ...
-3
votes
0answers
26 views

Batch to extract a number from a string inside an existing text file into a new one

I have a file *.idoc (text file) like that: [Image = B4montage690x0000.tif] TiltAngle = 0.000488 PieceCoordinates = 0 0 0 StagePosition = 111.069 -753.257 Magnification = 690 Intensity = 0.787 ...
4
votes
3answers
83 views

Use DOS batch to move all files up 1 directory

I have created a batch file to be executed through the right-click menu in Win7. When I right-click on a folder, I would like the batch file to move all files (excluding folders) up 1 directory. I ...
0
votes
1answer
38 views

Replace FTP with SFTP to transfer files - PSFTP.EXE ONLY

I am currently FTP'ing file to a unix box from a windows server. I want to change the following section of the script and migrate the ftp process to be sftp. @echo off echo user %user%> ...
1
vote
1answer
46 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 ...
1
vote
0answers
45 views

APC Smart-UPS 1000VA - command file won't get executed

I've got this old piece - http://goo.gl/5M37Sc, working reliably so far, but it has one big problem: command file when power is down won't run. Everything seems to be configured correctly, but when ...
-1
votes
1answer
20 views

Export windows Environment variables to a file. [duplicate]

Can we write a batch file to export all or some environment variables to a file in windos 7?
0
votes
0answers
44 views

Batch file needed to query a specific location

I am not a coder and would appreciate any assistance. I need a batch file which will query a NAS location and produce an output of the upper level directories (and maybe the second level down). The ...
1
vote
1answer
35 views

running batch file within powershell

I'm running a batch file within PowerShell. It calls up another program to do a bunch of maps which it outputs to a subfolder called "GRD" I then want to rename the files in the GRD folder by adding ...
0
votes
0answers
17 views

Copy multiple files to folders. Use filename

How do I move multiple selected files to folders with using the filename? Any tool or cmd is welcome :) One file a time: press Win + R and type in shell:sendto create a new textfile in this ...
0
votes
0answers
21 views

How can I start a batch script before open some type of file?

I'm writing some custom lock file system for my company. I want to start my lock_engine.bat before open some type of file. for example here my bat: @ECHO OFF set FILENAME=%~nx1 echo. is locking ...
0
votes
1answer
55 views

Batch rename all files in folder to uppercase

Is there a way to rename all files in a specific folder to uppercase? I found this code but it renames files to lowercase, can it be modified to change to uppercase instead? for /f "Tokens=*" %f in ...
1
vote
2answers
46 views

.bat file doesn't work with comments at top?

I have a .bat file I made to combine multiple files into a new file and it previously looked like this: copy /b ^ E:\file1.txt+^ E:\file2.txt+^ E:\file3.txt ^ E:\output.txt :: comment That worked ...
0
votes
0answers
23 views

Replace “open command window here” to open git sh.exe bash

Is there a way to replace the default option in windows context menu to open command window in the current directory to open git's sh.exe bash in the current directory?
0
votes
0answers
27 views

Remotely use a local account to unlock another local account

So I have had an interesting problem pop up. I am trying to make someones life easier by making a script to help reset local accounts on windows 7 machines. Ideally, we'd like to do it remotely, so ...
-2
votes
0answers
28 views

Check if each file in a list exists

I have a .txt with a list of name files: 111.pdf 222.pdf 333.pdf ... I need a script that checks if each of these files exist in a given folder, e.g. c:\files\. Is this possible?
0
votes
1answer
59 views

Windows Batch File (WMI) - taskkill process based on memory usage

Is there a way using WMIC, bat files, or powershell, to kill a task with a particular task name if the amount of virtual memory the process is using is above a certain limit? Specifically I want to ...
2
votes
1answer
53 views

Opening local batch file from Chrome bookmark

I have a batch file located at C:/bat.bat on the C drive of my Windows 8 system. I created a Chrome bookmark that points to the URL file:\\\C:\bat.bat. When I click the bookmark, Chrome shows the ...
0
votes
0answers
9 views

Error in Creating Android Project Using Cocos2d

When i am trying to create the project using cocos2dx i am getting this error of cygwin.Even though my path is correct for cygwin which is C:\cygwin\bin.My project is created but it is missing few ...
1
vote
2answers
114 views

bat file behaves differently when run from windows scheduler

I have a .bat file S:\BACKUP_db\copytofileserver.bat, which takes some files and zip them to the network drive. Its first command is to delete the old backup at specific network path, then pack the ...
-1
votes
0answers
12 views

Windows SUA, Batch File replacement

what i miss most from *nix OS's are shebangs and especially dislike batch files. But jumping into an SUA interactive shell is sometimes an extra step I would like to skip. Can we have windows ...
0
votes
1answer
32 views

Batch file in windows scheduler

set PATH=C:\Users\... call date2.cmd md %DT_MM%-%DT_DD%-%DT_YYYY% cd %DT_MM%-%DT_DD%-%DT_YYYY% So, I set my path to the folder that has PSFTP for me to run and run a file that will get the current ...
-1
votes
0answers
32 views

Windows script to copy files from C:\ to Backup B:\ but leave a SYMLINK copy back on C:\

I have a particular way to "backup" my stuff, in that I copy everything large (movies) etc from my main drive C:\ to an external backup drive B:\. Then make a SYMLINK of the file on B:\ back to C:\, ...
0
votes
1answer
28 views

Run a block conditionally on grep output

I've found a number of solutions to this problem, but unfortunately none of them seem to work on my windows box. I'm running a FOR loop in a batch file to loop through a number of text files. For ...
0
votes
1answer
51 views

Windows batch file - How to pipe output to text file and then open the text file?

I have a weird problem where I have a simple batch file that runs another batch file, outputs what is on the screen to a log file, and then attempts to open the log file. The problem is, the log file ...
1
vote
1answer
36 views

How can I write a windows batch file that opens a command prompt and executes a command?

I want to create a .cmd file that opens the command line at a location relative to the .cmd file itself, and then executes something like this: someapp start ../../config.js How can I do this?
0
votes
1answer
31 views

Writing time in a file in a for loop

In windows 2008: I'm trying to zip and copy files to a backup server. I use command line/batch file, I log the result in a log file, I now want to log also the time for each file looped. The ...
0
votes
1answer
48 views

Batch Issue - Creating folders and Moving Documents

I’m trying to create a batch script in Windows 7 that will look at the first 6 numbers of 100s of pdf, create a folder based on the 6 unique numbers and move the pdfs into their respected folders. ...
0
votes
1answer
26 views

Batch file XCOPY cannot find existing directory

I'm writing a small batch file to copy my C# project to another drive. I'm using XCOPY to copy an entire folder (We have some XP machines still, so robocopy isn't an option). However, when I run the ...
7
votes
3answers
507 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
12 views

How to hide cmd window of a Calibre Content Server batch script? [duplicate]

So I manage to be able to share more than one Server Content at the same time with the same PC. If someone want to know how can I do this, is easy. Make a batch script and put this: @echo off ...
0
votes
1answer
93 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" ...
0
votes
1answer
54 views

Windows scheduled task - .bat runs forever

I've a scheduled task to clean up folders on a hard drive automatically; it removes files older than a certain amount of days. Basically it runs a .bat file full of lines that looks like this: ...
0
votes
0answers
52 views

Windows batch script: Manual power up vs Wake on Lan (WOL)

OK, I have a (win 7) desktop computer with WOL set up so I can turn it on remotely, it works fine. Next thing, on this computer I have a batch script, which runs at startup and starts various apps, ...
0
votes
0answers
17 views

How to install the tool(exe) and change settings in it using batch file?

I want to run the installation(which is a single step procedure) of one of the tool(exe file) then in that tool,select File -> Settings and do some settings(select one option(which is a Radio button) ...
1
vote
1answer
90 views

Executing a BAT file as a domain user from a service in Windows 7

Firstly a few basics: I am running a database server application which runs as a service ServiceA. ServiceA is installed on Server1 and Server2 ServiceA only runs on one of the two servers at any ...
0
votes
1answer
31 views

Batch file: Concatenating list of files from array

I have a list of files, say a, b and c. If I need to concatenate them in that order into a single file, I'd use: copy /B a+b+c outputfile How do I do the same if the filenames are in an array? Eg: ...
0
votes
0answers
24 views

Launching batch files from PortableApps

Being a big fan of PortableApps, and of Textpad, I noticed that later versions of Textpad, provided you have a valid license, allow you to create a portable version of it. So I did that, installed it, ...
-1
votes
1answer
38 views

Logging in to putty by sesu as superuser and running commands

I need to automate using a bat file where I need the following things to be done: log in to server using putty/plink sesu to super user run certain commands get the outpout in a text file I can ...
-2
votes
1answer
37 views

Loop Counter not working

@echo off setlocal enableextensions enabledelayedexpansion set /a eng_aud_count=0 set /a eng_sub_count=0 For /f "tokens=1-9 usebackq delims=.:^)^( skip=2" %%A in ("MY text File") do ( set trck=%%B ...
1
vote
0answers
125 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 ...
0
votes
1answer
18 views

Winzip without command line addon

I'm trying to untar a file and the software installed on the computer is Winzip, but I've been told that the command line addon isn't compatible with Windows Server 2003, so it isn't installed on it. ...
1
vote
0answers
48 views

CMD install based on OS type and architecture [closed]

I am looking for a way to do a CMD install based on OS type (XP, Vista, 7, 8) and architecture (x86 or x64). So for an example if the script detects the OS is Windows 7 x86 (regardless of ...
0
votes
2answers
76 views

Batch file rename with random alphanumeric

I am looking to rename a bunch of images (all with .jpg extention) with random alphanumeric names. Example would be 08kDRH1s.jpg or 0FwzUc3.jpg. Doing some searching I did find a few batch scripts ...
0
votes
0answers
19 views

Batch-file pseudo random

Is there a way to do pseudo-random in batch? Simple random is very bad for my program. It's better to looks like: call:random var 1 100
0
votes
1answer
95 views

Simple batch file fails on Windows Server 2012

On a Windows 2012 Server, from a logged-in Administrator (local and domain), created a batch file "test.bat" by redirecting console input into a file: echo Hello When run from PowerShell cmd prompt ...
2
votes
4answers
59 views

Batch file. Variable in variable

How to use variables in variables? This code: set newvar=%var%var2%% doesn't work. So, what to do? I can't write my program without it.
0
votes
1answer
41 views

Batch file. If statements in if statements

I am trying to write this code: If %dropmode%==on ( If %drop% LEQ %potiondrop% ( set /a potion=%potion%+1 ) If %drop2% LEQ %potiondrop% ( set /a potion=%potion%+1 ) ) So, condition "if %drop2% LEQ ...