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

learn more… | top users | synonyms (1)

0
votes
1answer
33 views

FOR, IF and SET all are not working together [duplicate]

SETLOCAL EnableDelayedExpansion FOR %%A IN (1 2 3) DO ( IF %%A EQU 1 ( SET CHOICE1=ABC ECHO CHOICE1=%CHOICE1% ) ) Output: CHOICE1= Why is CHOICE1 not getting set?
0
votes
1answer
145 views

String replace inside a for loop in bat script

The replace is go well in this script. I am trying to make it dynamic. SETLOCAL enabledelayedexpansion for /f "tokens=* delims= " %%a in ...
1
vote
0answers
121 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 ...
3
votes
1answer
393 views

Windows cmd output redirection to standard input ( >&0 )

From a question on Stackoverflow, i've being testing with redirection from/to stdin stream. And this tests, trying to send data to the stdin stream, just to see what happens, end with an apparently ...
0
votes
2answers
100 views

Run other cmd in bat like from it's own path

I need to run bat(fix.bat) in cmd batch file (let's say sample.cmd on c:) The problem is that despite of using: start /WAIT cmd.exe /C D:\dev\sys\fix.bat fix.bat runs like from parent command ...
0
votes
0answers
21 views

Want to write batch script on the basis of system date and exit code

This is MY first question in this forum, Hope any one of you can fix the issue.. I have one log file containing the pattern as below "abcd.job" (abcd.bat) Started 27/8/2014 5:00:00 AM ...
0
votes
0answers
27 views

command for running script?

I was wondering what command would get the batch file to read a seperate text file and use all of that code in a database.. if that didn't make sense I'll do my best to explain: I have a text file ...
0
votes
1answer
129 views

Batch file to read a file and create a JSON?

I have a text file with some dozens of entries in the following format: code: SETX id: 1 msg: Message for setx code: SETY id: 2 msg: Message for sety msg_ja: Japanese message for sety As you can ...
-1
votes
1answer
147 views

How to rename 7-Zip split files as name_00N.zip instead of name.zip.00N

On Windows, when I create .zip split files with volumes less than 20MB with a command like: 7z a name.zip files\* -v20M I get one or more files named name.zip.001, name.zip.002, etc. I need to ...
0
votes
1answer
89 views

.bat file to rename files (not bulk)

I take pictures of airplanes. When i put them on the computer they are named DCS_5678 (or anotrher number :p ) The way i catalogue my pictures is by renaming them as followed: ...
0
votes
1answer
70 views

Parent process details from the batch script - find out what called the batch script

We have a batch file which is calling php scipts. Php script load some data files to our system. I cannot understand what is starting that batch file in the middle of the night. I cannot find any ...
1
vote
2answers
165 views

BAT file: Delete all files in directory older than 5 days except one file

I have a directory with many temp files. All files older than 5 days can be deleted except one file 'DoNotDelete.txt'. Therefore I should add an extra argument to my current script: forfiles /p ...
0
votes
0answers
20 views

Start applications on specified screen at startup (Windows 8)

What I would like to do is have all my programs that start on startup to popup on predefined screens. Now, since we configure applications to start on startup by adding a shortcut to the startup ...
0
votes
1answer
116 views

Start a program after waiting for user input

I'm writing a .bat file, and I'd like to start a program after waiting for the user to press any key. I tried the command below, but I got and "Invalid syntax" error: timeout /t -1 foo.exe
1
vote
0answers
104 views

.bat script doesn't work by using window scheduler

i created a .bat script to perform daily folder compression. it is working fine when i double click the .bat file. However, it doesnt work when i include it in window scheduler. Below is the script: ...
0
votes
0answers
41 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
117 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 ...
4
votes
3answers
345 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
271 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
91 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
139 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
31 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
69 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
515 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
26 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
22 views

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

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
247 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
58 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 ...
1
vote
2answers
414 views

CMD delete specific files and log all output

Hi guys ive written a script for a school im 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 ...
0
votes
0answers
114 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
231 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 ...
0
votes
1answer
279 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
441 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
28 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 ...
2
votes
2answers
298 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 ...
0
votes
1answer
63 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 ...
0
votes
1answer
90 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
928 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
123 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
57 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
116 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
146 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 ...
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 ...
0
votes
0answers
14 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
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" ...
0
votes
1answer
305 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
343 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, ...
1
vote
1answer
864 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
84 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
105 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, ...