batch files are simple text files executed in a command to achieve a particular task or a set of tasks

learn more… | top users | synonyms

0
votes
1answer
159 views

Clearing temp files - Batch file pattern matching for *.tmp also includes *.tmpll

A file match for *.tmp also returns various *.tmpll files, is there anyway to restrict it to *.tmp files only? dir C:\*.tmp /s Also lists a load of *.tmpll files as well. Reason for doing this is ...
0
votes
1answer
119 views

How to create a shortcut to a file on Fileshare and hide the path from user

we are sharing a certain powershell script to our remote users; the powershell script wuill be hosted on the file share and the link(shortcut) to the bat file(which executed the powershell script) ...
1
vote
1answer
518 views

Pentaho Windows Batch file not running when executed on Windows Server 2008

I'm running a Pentaho Kettle Kitchen batch scripts on Windows Server 2008. When I launch the batch file, the Windows Command prompt pops up and then disappears. I've changed all files in the folders ...
1
vote
2answers
571 views

7zip logging & left-over .tmp files

I have a batch file that runs nightly to compress some PST's, it uses 7zip & generally is pretty successful. However it tends to create left-over .tmp files (9 over 2 days), I want to delete ...
1
vote
2answers
761 views

RoboCopy A File From The Web?

Is it possible to download a file from the web using RoboCopy? What would the syntax for that be? Here's what I'm trying: RoboCopy "http://www.google.com/" "C:\some_folder\" "index.html" /L /V /E ...
0
votes
0answers
117 views

Registry Export Using Script Run from CD Fails - Access Denied

I've written some scripts and .bat files to configure XP machines and I have created a CD with all these scripts on and execute them through a single setup.bat file which is also on the CD. One of ...
0
votes
1answer
181 views

Robocopy Copy “For Loop”

I'm trying to create a simple script that will robocopy several folders using the command below. When one folder is done copying, it moves on to the next. Does anyone have a batch/powershell for loop ...
-1
votes
1answer
100 views

Unattended Uninstall of IIS 7.0

I know there are scripts available on the Microsoft website to have an unattended installation of IIS, but I was wondering if there is anyone who can help me out with a script to have an unattended ...
1
vote
3answers
1k views

How can I hide ms-dos window when running a .bat file?

I am running a .bat file for my script (Scheduled Tak (CronJob)) per minute. When it run, seems ms-dos window short period of time. My batch code like this; @ECHO OFF C:\wamp\bin\php\php5.4.3\php.exe ...
0
votes
1answer
117 views

How do you log the output of startup.bat from a GPO?

I'm trying to write some .bat files for GPO. I would like a way to see the output of the script to help debug problems. For the life of me I can't get it to log anything. I have tried the ...
0
votes
1answer
1k views

Joining an Active Directory domain using netdom

I have a simple script to join an AD domain and rename the computer. When I execute these commands directly on the CLI, it works fine. When I execute the same via batch file, I get an error saying ...
1
vote
2answers
109 views

How to use date functions for linux batch specile?

First, I wasn't sure if belonged to StackOverflow or here, but figure this would be more applicable to server administration. We have a .tar backup file going to an offsite backup server each day as ...
0
votes
1answer
94 views

Batch file installing executable only gives SYSTEM permissions

So, I have a couple of batch files that install some executables and they work, but when the executables setup shortcuts on the desktop only SYSTEM has access to them. Is there a way I can prevent ...
1
vote
4answers
578 views

Setup.exe called from a batch file crashes with error 0x0000006

We're going to be installing some new software on pretty much all of our computers and I'm trying to setup a GPO to do it. We're running a Windows Server 2008 R2 domain controller and all of our ...
2
votes
2answers
1k views

Batch rename removing second letter in filename

I have about 300 .pst files that I have exported from Exchange 2010. Eventually, I'm going to import them into another Exchange/AD environment. In the original environment, the user names are as ...
2
votes
2answers
1k views

Scheduled task fails, but runs fine when triggered manually

We have a 2008 R2 server with a scheduled task that runs a .bat file which executes a call to a Java app. The task triggers just fine, but stops executing anything after it creates the log file. ...
3
votes
2answers
534 views

Windows Batch folder size

I need a command (like "dir") that lists all directories with their size. I need just a 1 level deepness but with the total size of a directory. For example >dirsize c:/mainfolder subfolder1 ...
26
votes
3answers
46k views

How to sleep in a batch file?

How to pause execution for a while in a Windows batch file between a command and the next one?
1
vote
2answers
983 views

Run exe on computer in network through batch file

I have few computers connected to the network and I want to create batch files to automatize the process of working with them. I have already created one used to shutdown computers at once. It is very ...
1
vote
1answer
165 views

Is it safe to write batch files with Unix line endings?

I think I ran across a bug in a batch file because it was written with unix line endings. Is this a known problem with cmd.exe running batch files in windows?
1
vote
1answer
2k views

Detecting a registry key with a space in the path from the CLI (or .bat file)?

I've run into a problem in which my experience (and Google-fu) have let me down. Basically, I need to push out KB968730 to a couple hundred clients or so. Naturally, would like to check for the ...
5
votes
3answers
517 views

Backup with Mercurial and Robocopy?

The Problem We would like to backup our critical files from several network shares to a removable hard drive. We want to automate the backup so we don't have to remember to run it. It needs to ...
1
vote
1answer
320 views

excecute batch command over MSI Package

I have a huge network of PCs that are all in a same domain (active directory). I want to enable WMI service and relative port, then set the domain's administrator credentials to WMI credentials over ...
2
votes
3answers
668 views

Using a for loop in Microsoft cmd.exe, how can I process only the files with a certain extension?

I have a the folder c:\test\ and two files in it a.txt and b.txtv. I would like to process just the files with extension equal to .txt. If I write this commands cd c:\test for %f in (*.txt) do echo ...
1
vote
0answers
177 views

Mapping Drives for VPN using CMAK

I'm creating a connection file for VPN using microsoft CMAK. The VPN connection works but when I try to map drives it maps the drive under the Administrator account on the local machine because the ...
0
votes
1answer
192 views

Batch file to check version on mass computers

Please help me to create a batch file to run the below command (multiple computers) and the result to a text file. dtcheck "computername" /cmd="version"
0
votes
1answer
112 views

How to know drive letter from a batch file is launched?

I would like to create a DOS/Windows batch file that copy files from a source to the letter drive from which this batch is launched. So, if i run the batch file from G:\ i would like it copy from the ...
2
votes
1answer
334 views

Shortcut on client to run bat file on a server

Is it possible to place a shortcut on a client which will run a bat (or vbscript) file on a server? (as opposed to the script running on the client) It seems pretty basic, but I'm at a loss how this ...
2
votes
1answer
146 views

Running a batch script as network services on windows

On linux I know you can run files under different users pretty easily but on Windows how do you do it? Do I have to log in under that user? Can I run it with the schedule system? I need to be able to ...
0
votes
1answer
439 views

Amazon S3 - Automated Backup Using S3Sync, Windows Schedule & BAT file

I am trying to build an automated background backup program to backup my entire website and its heavy photo folders, using Amazon's cloud storage service, S3. I am using S3Sync from S3Tools and have ...
0
votes
2answers
2k views

Script to delete Shortcut on each user's desktop

I'm looking for a script to remove a .lnk file that was placed on every user's desktop. I installed a program on a terminal server that put a .lnk file on every user's desktop, rather than putting one ...
2
votes
4answers
7k views

How to create a yesterday date in a batch

copy \\server01\E$\LogFiles\IVR\bcR\??120428.* \\LBC\workgroup\cs\ftp\Team\bcR\ copy \\server02\E$\LogFiles\IVR\bcR\??120428.* \\LBC\workgroup\cs\ftp\Team\bcR\ copy ...
1
vote
2answers
387 views

Running Linux Script from Windows in backgound

I'm using following script from my windows machine to run on linux and do backup. @ECHO off :: run remote command plink.exe username@myserver /home/username/do-backup.sh Problem with this script is ...
1
vote
1answer
857 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 ...
3
votes
1answer
671 views

Move directory in DOS (batch file) without knowing full directory name

In Bash I can move a directory without know the full directory name like so: mv gradle-*/ gradle/ How do I do this in cmd (i.e. batch file, not powershell). The move command doesn't seem to allow ...
1
vote
1answer
374 views

Scheduled service/script/batch file to move files on condition of other files with similar filenames in same directory on windows

On Windows Server (Data Center? 2008?), i'm trying to set up a scheduled task that will: Within a particular directory For every file in it If there exists (in the same directory) 2 files with ...
2
votes
1answer
466 views

Pass PIDs from tasklist and kill processes with tasklist

This relates to my thread Pass the PID from tasklist into taskkill to kill a process by the .dlls it's holding open. I am trying to do something like what was discussed in that thread: FOR /F ...
1
vote
1answer
341 views

How to set the Backup Identification Label of a job in NT backup using the command line

I'm using NTBackup on a server 2003 R2 system, to backup to a file over the network, using a batch script. What I'm trying to do is to change the name of the backup set as displayed in NTBackup's ...
0
votes
1answer
2k views

ERRORLEVEL built-in no longer works on Windows Server 2008

Using a couple of servers at work running Windows Server 2008 and noticed that my batch scripts are no longer failing gracefully. Put simply, any statement checking ERRORLEVEL seems to pass, no ...
0
votes
2answers
370 views

Nmap / Batch: alert if only ports usually closed are opened?

Context I check open ports on my server with a scheduled batch file: nmap.exe server1 server2 server3 etc >> log.txt Usually 21, 22, 80, 443 and 3389 are opened. Now I want to send an email ...
0
votes
1answer
576 views

Run batch files as administrator user

I have a segment with 100 computers. I am booting each machne from WinPE OS located on a CD. After the OS has finished loading, I want to automatically run a batch file that will copy the CD to the ...
1
vote
1answer
805 views

Win2008Server R2 - no window running .bat file via task scheduler

I'm running a couple of batch files via Task Scheduler that call rsync. The .bat files work great when run manually and appear to be running fine via TS as well. HOWEVER, it does NOT open a cmd ...
1
vote
1answer
11k views

Script to delete temp files for all users in XP, Vista, and 7

Basically, we have numerous customers running XP and 7 with a few Vista machines. I've found this batch script, but it is limited to the current user (uses the %userprofile% environment variable). ...
6
votes
2answers
2k views

Mass delete mapped & local printers

Is there any way to mass remove all local and network mapped printers from all workstations on a domain via group policy or a batch file? I need to remove local Windows 7 printers such as Fax, ...
1
vote
2answers
152 views

How to enable logs for execution of multiple URLs through cscript.exe & *.vbs bat file

I have multiple URLs to execute. I am currently using below method I am creatving a vbs file with below content Option Explicit Dim objIEA Set objIEA = CreateObject("InternetExplorer.Application") ...
0
votes
1answer
574 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 ...
0
votes
2answers
664 views

I Cannot create a .BAT file in the root of C “Access is Denied” Server 2k3

I have an oracle db server on a windows 2k3 box. I am currently unable to create or copy a batch file to the root of c. I can create batch files on different folders (i.e. in my user directory) or I ...
2
votes
2answers
1k views

What rights does an account require to log on as a batch job?

I've got a Windows batch script which I'm trying to get Veritas Cluster Server to control using the process agent. The batch script needs to run as a particular user, but when I try to online the ...
0
votes
1answer
359 views

mkisofs - Floppy Image to Disk Image

I'm trying to compile MikeOS on windows. I've successfully (I think) created a floppy (.flp) image of the operating system. I want to convert it to a disk image (.iso) so I can run it in virtual box. ...
2
votes
2answers
1k views

How to execute a batch file each time a user logins?

I've written a batch script which copies of some files in the CommonAppData folder (C:\ProgramData) to the logged in User's Local AppData. What I would like to do is to execute this script for every ...