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)

0
votes
1answer
86 views

How to remove a line in a file found in multiple directories

There is file that exists in each user profile directory and I need to remove the line from the file in each user profile directory. I'm using a batch script to go through each user profile directory, ...
-1
votes
1answer
1k views

How to do a Batch file that get all files in a directory and zip it?

i would like to know how to get all single .bak (or anyother extension) files into a directory, and zipping them (one by one) and save them using the same name, changing only extension. Thanks
-1
votes
3answers
247 views

creating a bat file or cmd

I wish to create a bat file to create some basic task. When i run this it closes the window. I'm guessing it errors. How can i stop the bat closing the window so i can view the error. mybat.bat: ...
0
votes
2answers
3k views

Batch - Ping IP and execute different commands on return

I'm trying to make (hopefully a simple) script that when run pings my mobile device. If the mobile is connected to the network it will execute one command and if not it will execute another. I've ...
3
votes
1answer
585 views

trying to copy security groups to a user using dsmod group utility in AD

I am trying to create a batch file that asks to enter source samid and destination samid. Then using dsquery and dsget find out what security groups source samid is assigned to and assign destination ...
1
vote
1answer
252 views

Task scheduler not running (Server)

I have written a simple bat file to copy .txt files from one drive into another one. I want this to run everyday at this time but the problem is when I'm not logged in to the server the task does not ...
2
votes
1answer
188 views

How do I run bat file inside cmd using tash scheduler

How do I run bat file inside cmd using tash scheduler. I've tried this one C:\windows\system32\cmd.exe C:\synchronization.bat And doesn't working.
2
votes
2answers
251 views

Change windows group permissions without the sufficient rights in a batch

I wrote a batch file, which creates multiple folders und subfolders in the current directory. The group permission of one folder is also changed. This works on my local workstation with administrator ...
1
vote
2answers
2k views

delete all folders with tmp in name using batch file

Have tried to google this, but I always seem to get results relating to .tmp files, which isnt really any use. I have only a basic understanding of batch files, but I think I need something like ...
-1
votes
1answer
145 views

Virus creates exe files with text content [duplicate]

Possible Duplicate: My server's been hacked EMERGENCY Something automatically creates exe files like "zytudou.exe" on my PC with text content: open 122.138.203.175 123 123 get ...
1
vote
1answer
1k views

batch file infinite loop when parsing file

EDIT: Apparently I don't have enough rep to answer my own question, so the answer is going here. OKAY! SO! I didn't exactly solve the problem... but I stopped using cacls.exe and started using ...
0
votes
2answers
4k views

users unable to add registry keys to HKCU

I may not have this 100% correct so need some clarification. Are normal users on a 2003 terminal server allowed to add registry keys the their own HKCU section in the registry, or are they only ...
3
votes
1answer
910 views

Why does robocopy take 8 hours to transfer one files that is 70-80gb?

We have a scheduled task that runs every night and copies a file of around 70-80gb from one server to another on our network. For some reason it has been taking ~8 hours to do this, which is a problem ...
1
vote
1answer
256 views

Cacls, full permission, local names

I tried to use cacls to give "Everyone" group access to certain folder. And I failed. As I understand the reason is i'm trying to use groupname in english while my windows is localized. Attempt to use ...
1
vote
1answer
2k views

check for ping reply - unexpected result

I am running this within windows xp batch file: ping -n 3 10.1.1.2 >nul: 2>nul: if %errorlevel%==0 ( echo ping reply arrived ) else ( echo no ping reply. ) sometime, it seems ...
-1
votes
1answer
2k views

Create Batch file to execute multiple batch files and VBS files

I have multiple batch files and vbs files , when i try to create a batch to call them it stop after the last batch file and dont execute the vbs. without giving any error if i put the vbs at the ...
1
vote
1answer
1k 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 ...
-1
votes
1answer
650 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 ...
0
votes
4answers
826 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
2answers
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
637 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
60 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
2k 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
92 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
281 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
114 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
909 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
2answers
2k 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
5k 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
2k 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
1answer
932 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
140 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
239 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
3k 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
1k 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
2k 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
846 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
171 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
289 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
4k 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 ...
24
votes
4answers
79k 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
410 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
7k 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
202 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
82 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 ...