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
0answers
59 views

Display only the last line of a windows command line executable

I'm trying to write a batch script that manages simple software deployments. One of the steps in the script compresses a file structure into a 7zip archive. During the compression process, the z7ip ...
0
votes
1answer
280 views

Record more events with procmon [closed]

'Process Monitor' has a max history depth of 199 million events. I need to record about 10 times this. I don't mind if the data is split, e.g. a new data set for every hour. Anyone know how to do it? ...
1
vote
2answers
3k views

Can't run batch files from server, Users do not have permission to access file

We're trying to run some logon / logoff scripts on server 2008r2 domain controller. The script is located in the default group policy logoff directory ...
0
votes
1answer
56 views

Enable Recovery console from a batch

I want to enable the Recovery Console on a lot of Windows 2003 servers. I want to automate this so I don't have to manually do it on hundreds of servers. The recovery console install process seems ...
0
votes
1answer
49 views

Netsh batch file

Is there way to join win7 to server 2008 by using netsh batch file ? I can change The IP , GateWay , Subnet Mask by bat file but How can I join domain
1
vote
0answers
1k views

Is MSIZAP still useful, or is it obsolete?

I update flash using MSI files installed by group policy. However, with every update, about a third of the workstations fail to update (Windows Vista and Windows 7 32/64-bit editions). In the event ...
0
votes
1answer
139 views

Windows batch find folder if statement

Assume a file system with the following format Folder A --->Folder 1 --->Folder 2 --->Folder 3 etc.. Folder B --->Folder 4 --->Folder 2 --->Folder 3 Folder C --->Folder 1 --->Folder 2 --->Folder 3 ...
2
votes
1answer
809 views

Batch - how to copy file by minimum size and date modification?

I have this simple batch script which copies the newest file in some dir to another place. I want this script to also ignore all files (in the DIR command section) under 1GB of size. FOR /F ...
0
votes
1answer
354 views

Elevate batch file via UAC

I have found the following routine which is supposed to allow a batch file to issue a UAC prompt and elevate itself to admin. Problem is on Server 2012 it doesn't seem to work for me. According to ...
0
votes
1answer
186 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
129 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
692 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
760 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
1k 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
120 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
244 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
106 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
120 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
2k 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
118 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
95 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
729 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
2k 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
2k 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
708 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 ...
30
votes
3answers
60k 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
2k 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 ...
2
votes
1answer
184 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
560 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
331 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
700 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
200 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
199 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
120 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
405 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
154 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
488 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
8k 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
459 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
963 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
789 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
432 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
526 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
410 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
413 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
646 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 ...