A batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter under MS-DOS and Microsoft Windows.

learn more… | top users | synonyms (1)

1
vote
1answer
827 views

How to restart atd without affecting running jobs?

Does anyone know how to restart atd without affecting current running (batch) jobs? I guess I could move the jobs out of the spool directory and wait for the current running jobs to finish, but I'm ...
0
votes
1answer
676 views

Why does BitsAdmin.exe not finish a download and leaves just a tmp file?

Still learning how to use BitsAdmin.exe in batch files. Here is my script, which fails to finish downloading a file, and leaves just a temp file called "BIT851.tmp" on my desktop. Any idea what I am ...
-1
votes
1answer
538 views

Copying a set of local files to ftp

I want to copy a set of local files to ftp://124.30.124.230 (it will ask for a username and password). I want to do this work on 400 systems so I have planned to do this work by creating a batch file ...
1
vote
1answer
260 views

How to issue an rsh command in the background?

How to issue an rsh command to run in the background? Example: within a batch file i call rsh 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh which runs on a remote unix machine. This script takes a ...
0
votes
4answers
716 views

Windows XP batch file to block all incoming and outgoing traffic

Is it possible to block all incoming and outgoing traffic on a Windows XP host via batch file? Bonus question, I only want to allow 1 outgoing port and all traffic going over that port.
1
vote
1answer
45 views

Single batch with different configuration for different machines [closed]

Is there a way I can have a single batch to run different configuration according to the Computer name ?
0
votes
3answers
1k views

Transferring files from ftp to local system

I want to copy a file from FTP and paste it to my local system. I want to run this through a batch file. I am trying this for a week. But I couldn't find the solution. Anyone help me please.... This ...
2
votes
3answers
485 views

I need to clear out the same directory on multiple servers across a network. How do I do this?

On multiple (about 20) servers, there exists the same directory C:\Deployments. This directory has multiple subfolders which contain more subfolders and files. The C:\Deployments directory itself ...
1
vote
1answer
59 views

Preforming an Administrative task, with a service account, via batch

Trying to install a piece of software from a network location, and everything works great except the software requires admin rights to install. Is there a way I can pre enter an admin service account ...
0
votes
1answer
45 views

Test the proper execution and integrity of a backup

Every night my company generates automated backup all our servers on a backup server: -- backups folder ---- server1 backups folder ------ server1_backup_files.7z ------ server1_backup_db.7z ---- ...
0
votes
1answer
78 views

Creating Directories with a Batch file [closed]

I am intested in creating a batch file that can read in a text file which has four variables: customer name, customer number, customer order, products orders. I am using: FOR /F "delims=, ...
1
vote
1answer
926 views

Change Registry Value Command Line

Is there a way to set a registry value with a command line without using a .reg file to import it? I've looked over the reg and regedit.exe command line options, and it doesn't look like there's a ...
1
vote
1answer
1k views

I'm trying to make a batch file that will ping multiple IP's and return the results in a text file [duplicate]

Possible Duplicate: Batch file to MASS ping group of computers on network by name, check reply, and resolve hostname I am trying to ping many IP's at once and to date it's been done ...
2
votes
1answer
86 views

I'm having trouble finding these commands to run in a batch file?

I want a batch file to pull information from the first line of a text file (notepad), use that information to add information to a DNS server, and then delete it. I'm thinking if I create a loop, I ...
0
votes
1answer
254 views

Problems encoding an HTA file to run Java+Batch files for DNS server

I'm having a problem coding a .HTA file, and I really need some help. I've been searching all over the place and I can't seem to find what I need to add to this code to make it run. I'm trying to get ...
1
vote
1answer
110 views

Why can't I get the `for` command work in my command line [closed]

This could also be read "Why can't I get the for command work in my batch file." When I try using the command: FOR /F "tokens=1-4 delims=/ " %%a in ('something cool') DO something else cool %%a %%b ...
0
votes
2answers
816 views

Remote GPO through BATCH Script exiting

Right so, I'm trying to make a remote GPO script that from one of our management machines will push the GPUPDATE command to certain servers. After some googling I found a script that I tried to ...
0
votes
1answer
1k views

Server 2008 issue running batch file

For the life of me, I can't seem to get a batch file running in Server 2008 Task Scheduler, despite it not having the common problems I've seen before. Problem so far: I have a batch file that ...
0
votes
3answers
4k views

Deleting the oldest file in a folder with batch scripting

I have to write a batch file to delete the oldest file in a folder, but i don't know how to get the name of the oldest file. I can sort files with DIR, DIR /B /O:D /T:C but this is a list and i need ...
2
votes
1answer
1k views

Dos Batch File Help: Storing %%c variable from FOR loop [Resolved]

It's been a while since i've had to write a batch file, and i'm having trouble with the following: @echo off SETLOCAL ENABLEDELAYEDEXPANSION for /f %%a in ('dir f:\*mssql* /ad/b') do ( for /f %%b ...
1
vote
2answers
1k views

Run batch script showing output & recording output to a file

I know cmd > file.txt to record an output of a command to a file in Windows!. Does anybody know how to run a batch script recording the output to a file AND also showing the output on the command ...
1
vote
1answer
815 views

command line REGEDIT command (edit) without a popup

I am attempting to disable UAC via a batch file with a REGEDIT command, and everything works - but, I need to be able to do this without clicking. When I run the: REGEDIT /S somefile.reg It works ...
1
vote
3answers
136 views

Running a batch file as an admin

Is it possible to run a batch script as an administer? We need this to be done without any user interaction, so there can't be any password prompt or UAC popups - is this possible?
-2
votes
1answer
225 views

shell script doesn't run correctly in cron [closed]

I want to call a shell script I wrote from a cron. The shell script uses the program Linkchecker. If I run the shell script from the terminal it works just fine. However, when cron runs I get the ...
2
votes
3answers
2k views

keep command window open after running bat file

i have a bat file that has the following it: sm start "Schedule" this code runs but the command window closes immediately what can i put inside the bat file to keep the window open?
1
vote
2answers
940 views

How to automate FTPS uploads from the Windows Command Line

I'm looking for a batch script to automate the upload of MULTIPLE files at a time to an external ftps site (ftps://servername.xxxx.com).The files are located in a folder on a Windows Server 2008 ...
1
vote
1answer
1k views

How can I use a batch file to dump only the last few weeks' revisions in SVN?

We were previously backing up our full SVN dump each night, but the repository has now become too large. If I was willing to cut off the revision history at say 2 weeks, how would I go about making a ...
1
vote
3answers
730 views

“svn update” on a remote machine

I need an ability to run "svn update" on a remote machine for a non-technical user, how would I go about it? Our non-techincal users are using Windows XP and have Tortoise SVN client installed. I'm ...
0
votes
2answers
157 views

.bat file question

I'm working on Windows XP. I need the batch file to do the following: Create a directory $DOMAINNAME on D:/Webserver/domains/%DOMAINNAME/www/ Open the file - ...
0
votes
2answers
283 views

Batch command to schedule multiple servers to shutdown

Our company is in the middle of a move between buildings. I've been asked to schedule the majority of our servers to shutdown at midday tomorrow. They already have a scheduled task for this, which ...
0
votes
2answers
3k views

How can I find multiple values from windows command line output?

Example, to see if KB983590 is installed: systeminfo | find "KB983590" But what if I wanted to find out if more then one KB was installed?
0
votes
1answer
1k views

purging files using forfiles in a batch and running that batch from a task

I have the following in a batch file that works perfectly fine if I execute it manually but fails when I tell the task scheduler to run it. forfiles -s -m *.bak -d -4 -c "cmd /c del @path" This ...
19
votes
4answers
68k views

Get directory containing the currently executed batch script

I use %0 in batch file to get the containing directory of the batch file but the result is :- c:\folder1\folder2\batch.bat I want just directory, without batch file name, like this :- ...
0
votes
1answer
252 views

How to create a windows user from the command line, using a password from a file

Im in a somewhat unique situation. I am trying to create a windows user, using the command line or a batch file. I know how to do that in the basic case: net user username password /add The ...
2
votes
1answer
5k views

Split string line read by a batch file

is there a way to "split" the value of string line readed by a batch file ? Suppose to have this text file 192.168.1.2; PC_NAME_1 192.168.1.3; PC_NAME_3 ... I would like to read line 1, and split ...
0
votes
1answer
200 views

Install cmd script to set user environment variables from file

Each line in input file.txt has two values separated by a space. Currently using: for /F "tokens=1,2" %%i in (file.txt) do call :setvars %%i %%j :setvars set %1=%2 set %3=%4 set ...
0
votes
1answer
201 views

Help for batch file

I have to create a Windows XP batch file to copy files from a series of computers into a directory on another machine. I've a text file with our internal LAN IPs like this: 171.10.2.2 171.10.3.2 ...
1
vote
0answers
81 views

Why is my IF comparison op failing?

update SOLVED - the problem is not with my code. there is a design limitation (some might say "bug") in the command processor. the IF comparison operators do not work with values higher than ...
0
votes
3answers
1k views

Autostart Cygwin on Windows boot and run a cygwin command

Sometimes my Windows server reboots at night to install new updates. Then the next day I find out that my cygwin instance has been stopped. What I want is on Windows start, also run Cygwin AND run a ...
0
votes
1answer
602 views

Rename folder using wildcard windows

I've got a piece of software that includes its own backup utility, but it generates folder names with the current date and time appended. I'd like to write batch script that will remove the date/time ...
1
vote
1answer
446 views

more than one start statment in the same batch file?

I wrote the following batch file: start D:\folder1\bin\run.bat start D:\folder2\bin\run.bat start D:\folder3\bin\run.bat start D:\folder4\bin\run.bat It executes the first start but then gives me ...
3
votes
5answers
4k views

Is there a way to submit a batch of commands to a Cisco router and have them execute from the router?

I need to change the configuration of a remote (6 hours' drive) client's Cisco 871 (IOS 12.4.15T) from my location because of some new internet service at his location. To be more precise, I need to ...
7
votes
2answers
6k views

Locale-unaware %DATE% and %TIME% in batch files?

The %DATE% and %TIME% environment variables provide the current date and time on Windows machines on the command line and inside a batch file. Sadly, those values are locale-aware! Meaning that, say, ...
1
vote
2answers
3k views

Running a batch file as a system service in Windows Server 2003

I currently have a batch file used to start a voice server application in C:\Teamspeak. The application cannot start directly because the batch file passes settings to the application. Is it possible ...
2
votes
1answer
973 views

VboxManage in a Batch File

I have the command below in a windows batch file, whenever I run the above batch (ipconfig.bat) to get the ip of my linux vm, it outputs the ip fine but doesn't ends the batch file, I have to press ...
2
votes
3answers
2k views

How to put DayOfWeek value into file name?

I would like to use the numerical part of the output of "wmic path win32_localtime get dayofweek" to number backup files. Something along the lines of: FOR /F "tokens=2 delims=\n" %%DoW IN ('wmic ...
1
vote
3answers
1k views

.bat files to find all files on drive bigger than X

So far I run a .bat file to find all the media files stored on our student shared drive, which then writes to a .txt file in my documents, for example: dir S:*.mp3 /s > "M:\logs\student\mp3.txt" ...
1
vote
4answers
1k views

Batch file to change all network shares on computer

I need to change all shares of //foo to //bar in a batch file. Say i have R: //foo/foo and Z: //foo/bar I need to have a batch script that makes them R: //bar/foo and Z: //bar/bar Anyone have any ...
0
votes
3answers
7k views

Send a batch file to a Windows machine, and execute it

I know PsExec is perfect for sending files over a computer on a network and then execute it on that remote computer, however I can't use PsExec because I'm developing a piece of software and I can't ...
4
votes
5answers
2k views

shortcut for Eventvwr > Connect to another computer

I was wondering if you can write the following action in a batch command? eventvwr (open the event viewer) Menu Action > Connect to another computer Type in the name of the computer. Connect. This ...