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

2
votes
2answers
60 views

Start /wait in batch file stops waiting after ~5 minutes

I need to copy some large sets of files from one server to another (DICOM imagesets). I've written a batch file to automate the process. The batch file reads a text file with a list of cases to copy ...
0
votes
1answer
23 views

how to Install java run-time /jre on a custom path using a Batch script?

Im trying to create a bat file to make an unattended installation with sccm. I downloaded jre-7u55-windows-i586.exe from ...
0
votes
1answer
48 views

Is there any way to add an HTTP Header to every IE request on a computer?

I would like to add a custom HTTP Header to every Internet Explorer request on a computer (or every browser request). I don't know if this is possible whatsoever, if you have heard of anyway to ...
0
votes
2answers
37 views

Copy folders to network directory

I'd like to copy C:\users from every client's computer to a network share \\. Reason being we need to take backups of this folder and its contents prior to maintenance. Is it possible to achieve this ...
1
vote
2answers
40 views

windows - how to make some file impossible to remove/rename for all users via commandline

how to (using command-line/batch file only) make some file impossible to delete/rename for all users. I tried attrib +R on file itself and on directory where it exist but it doesn't help
1
vote
1answer
24 views

copy file with date appended

I am writing a script that copies files to another directory. I wanted to append the date to the end of the file but when I try to use %date% I get the following: copy c:\mydir\file.zip ...
0
votes
0answers
35 views

Windows Server 2012: Dump local security setting to a txt file

Is it possible to dump the local security settings to a txt file using PowerShell or a batch script?
1
vote
1answer
47 views

How to catch “The system cannot find the file” within For /F loop?

How to catch "The system cannot find the file" within For /F loop? I would like my code to do the following: 1 - Search for the specified file 2 - If file not found, handle the "The system cannot ...
0
votes
0answers
48 views

Windows Update on multiple servers

I have about 500+ servers( Win 2003, 2008, 2012). At the moment patches are set to available by SCCM. We need to login to the servers and download n Install the patches. Once it done we restart the ...
-2
votes
1answer
24 views

Batch file to autorun when computer is inactive

As the title says, I want a batch file to autorun when the computer (mouse, keyboard, etc ...) are stopped (inactive) for at least 3 minutes. Help?
1
vote
1answer
65 views

how can I download web pages from the command line in windows

Well, I'm trying to do some automation using batch file to speed up my daily routine at work, and I need to solve these little questions: I want to install wget command, but using only the pure ...
1
vote
1answer
78 views

WMIC Command works, but doesn't work in powershell script

#Get Data Rate wmic "/OUTPUT:'C:\Users\user\Documents\DATE RATE\Data_Rate-ts8"+".txt" nic where 'NetEnabled = True' 'get Name,MacAddress,Speed'" Running this in the console directly works. That is ...
1
vote
0answers
803 views

Clearing Out SCCM Cache On Client Machine Automatically

I would like to run a script that clears out the SCCM cache on a client computer automatically. To do this, I have written a simple batch file: if exist %Windir%\ccmcache ( RMDIR ...
1
vote
1answer
206 views

Run Bat file in Administrator Mode in Windows Server 2008

runas.exe /profile /user:administrator "C:\temp\SQLSP3.bat" will run the SQLSP3.bat file in Administrative Prompt and it is asking Adminstrator password in Windows Server 2008. SQLSP3.bat file has ...
0
votes
1answer
32 views

How to change AWSTATS configuration via cli

My Apache log files have the date included in the name and I can't change this. Is there a way to change the LogFile config parameter for AWSTATS using Windows CMD prompt? Better yet a batch script? ...
1
vote
1answer
150 views

How to auto-run batch file as specific user (not scheduled task, not a duplicate)

I am an enterprise admin (Sr. Network Engineer), but my team does not manage Active Directory, so I am a little unfamiliar with policies and what is required to do what I am trying to achieve, and ...
1
vote
0answers
37 views

Data Execution Prevention - Optout for the exe in “C:\Program Files\SSS\sss.exe” using Command Prompt

Can any one help me in adding "C:\Program Files\SSS\sss.exe" in DEP Exception list using Command Prompt?
2
votes
1answer
2k views

Running a Batch File from Task Scheduler Without User being logged In

I'm trying to run a batch file on Windows 7 from the Task Scheduler. I can run the batch file fine if I run it from the command prompt. If I run it from the Task Scheduler to only run when the user ...
1
vote
0answers
26 views

DSADD in batch file - syntax incorrect! Same command in command works fine

Really stumped here and I'm sure the answer is simple. Simply put, I'm creating a bunch of AD accounts based on input from a spreadsheet. I've been able to concatenate the fields into a DSADD command ...
1
vote
1answer
60 views

Is there a way to run a script file that searches for files BUT excludes hidden files and folder?

I need to search some windows servers for files created after a certain date. I have set something up with forfiles but would like to speed up the process and reduce file size of the output file by ...
0
votes
0answers
176 views

Do CMD scripts run faster than BAT scripts?

I recently heard from someone that Windows Admins should use CMD logon scripts over BAT logon scripts, as the run or execute faster. Apparently BAT scripts are notoriously slow. I've done a bit of a ...
0
votes
1answer
64 views

How to rar the newest (The latest modified date file) file?

I have the folder c:\AA\ that everyday there will be a new BAK file. When I run the command it will re-rar every files not just the newest file. I use this batch code: FOR %%A IN (C:\AA\*.txt*) DO ...
1
vote
0answers
61 views

Running psexec on Windows Server 2008 R2 from Windows 7

I'm trying to successfully run a batch file located on a server pc (Windows Server 2008 R2) from my Windows 7 client PC. But its not working and the command prompt shows the following error ...
0
votes
1answer
54 views

Wbadmin [startbackup] keeps prompting for password

I am running Wbadmin for backup purposes in a batch file, however the batch execution halts, prompting for a password although the password is provided. First attempt - include password in command: ...
3
votes
3answers
204 views

How can I install any program unattended on a Windows PC?

I asked this question at stackoverflow but I was referred here. I have a server which I will store the installers of the programs I want to install to the client PCs. The client PC will download the ...
0
votes
0answers
753 views

Run an executable on a remote computer with a batch file

I'm trying to see how to setup a batch file that a user would run from an application hosted on Citrix XenApp, such that it launches a .exe from their local computer rather than open the application ...
3
votes
2answers
381 views

Is there a way to change passwords on multiple servers simultaneously?

x3 Server 2012 R2, x2 Server 2012 My system has 5 servers; 1 Hyper-V server hosting 2 vm servers (these are the x3 2012 R2 servers), and a Win 8.1 pc running hyper-V that hosts 2 more vm servers ...
5
votes
2answers
998 views

How to query the task manager

I know the tasklist command in Windows will give a list of task names and their PID. There is another command WMIC path win32_process get Commandline which does give more detailed information, but its ...
1
vote
1answer
518 views

Batch File to Automatically Install List of Drivers without User Interaction

At work, one of the tasks I am responsible for is resetting computers to their factory settings and installing the updated drivers. Lenovo makes this easy with their System Update tool, but Dell and ...
2
votes
3answers
126 views

How to see what last batch was run on windows

Is there a way to see what was the last batch (something.bat) run on windows? I was in a folder which contains lots of batches, as I was opening them one by one by right clicking and selecting ...
0
votes
1answer
197 views

How to remove string and replace with content found in text file using batch script or powershell

How to remove string and replace with content found in text file using batch script. test.txt Version: 4.5.0 Import: //MPackages/Project/config/abc.txt #head ...
0
votes
1answer
2k views

The system cannot find the file specified- Task Scheduler. Win Server 2012

I have batch script file, which should encrypt a file with pgp. I have defined a task in task scheduler to do this, but I am keep receiving the error"The system cannot find the file specified". ...
0
votes
1answer
172 views

xcopy on Batch file for backup server

i have 5 servers connected and want to backup a folder on servers 1,2,3,4 to server 5 and folder on server 5 to server 1. i write a batch file that use xcopy to copy the folders. my question is if ...
-1
votes
1answer
561 views

Execute bat file via php on a local network to run on any PC connected

I have a web app which runs on a local server (XAMPP)...its on a computer (PC1) which serve as a server..other computers are connected to the same wireless network and can run the web app also from ...
0
votes
1answer
274 views

Find 0kb files on a hard drive and replacing them with same name file from a different hard drive

Recently installed a new Windows 2012 Essentials server for a client. They had a very old XP system they had been using as a file server. Several weeks after what appeared to be a successful ...
-1
votes
1answer
52 views

Search for file names containing space

I have a batch file that helps me in install multiple pieces of software from a shared folder. It's working well with software whose names don't contain spaces, but I need it to work with software ...
0
votes
1answer
147 views

Batch script to increment the text file ans also the value inside the file [closed]

I have a text file Foo.txt which contains value content0. I have to create a batch file which increment the text file like Foo1.txt, Foo2.txt.....Foo5.txt and also the values in the file content1, ...
0
votes
2answers
480 views

Bat script start a program and than restart

I need some help creating a .bat script that starts a program and when done it restarts the computer. cmd /c C:\"Program Files"\"Toolwiz Time Freeze"\ToolwizTimeFreeze.exe /usepass=password ...
3
votes
1answer
808 views

Running Batch file with elevated rights through GPO

I have a shortcut that specifically uses Google Chrome. We have XP and Windows 7 in our environment, and I want to only use one shortcut for both OS. The reason being is that our environment is quite ...
0
votes
1answer
67 views

Modified batch file that kills a certain process

I am looking for a simple batch script that kills a process which listens to a certain ip and to a certain port. If there are less than 10 connections to this process, then it should be killed. If ...
0
votes
1answer
572 views

Icacls works from command line, not from batch file

The OS is Windows server 2012. I am trying to use command icacls C:\folder\targetfile /grant domain\usergroup:(rx) to give permissions on certain file. The command works when executed on command ...
1
vote
1answer
643 views

Batch file that kills a certain process

I am using the following script to kill a process in CLOSE_WAIT state that listens to a certain ip and to a certain port. FOR /F "tokens=5 delims= " %%I IN ( 'netstat -ano ^| find ...
0
votes
1answer
45 views

Cannot use PStool for more than 7 PCs over LAN

Below is the batch file command I am currently using to shut down remote computers on our LAN. Here is what it does. I have specified the remote computers IP address in text file named list.txt I ...
1
vote
1answer
662 views

IIS backup on Multiple servers from Powershell

Can someone help me with backup of IIS on multiple servers from powershell script remotely. I can take backup of IIS from powershell command. backup-webconfiguration -name IIS_backup. Also i have a ...
1
vote
0answers
260 views

How do I script a change to the msmq storage location on Windows 2008 R2 server

Is there any way of doing this through a batch or powershell script? I'm looking for a way to set up several new servers. The only thing I found on the subject leads me to believe you cannot: from ...
5
votes
1answer
8k views

Batch script is not getting executed when called by Start-Process Cmdlet

I have a strange issue on a Windows Server 2012 R2 here that just does not make any sense to me at all. I've got a PowerShell script that basically has the following structure: Function ...
0
votes
1answer
328 views

Clear Windows Temp Folder - Without listing or counting files first

We have a Windows Server 2008 machine running as a web server. We noticed a problem with one of our PHP based websites today, and the error message related to the session and access to the Windows ...
0
votes
2answers
335 views

For Loop in batch file [closed]

Expected Input: Start=1, End=500, Interval=100 Expected Output: 1, 100 101, 200 201, 300 301, 400 401, 500 @echo off set start=1 set end=500 set interval=100 for /L %%g in (%start%, ...
4
votes
1answer
317 views

How to get login username of the login that triggerred a task in the task scheduler

In the Windows 7 task scheduler, I have a task that runs when any user logs on. This task is run as Administrator so it can get the proper priviliges and runs a bat file. I would like to pass in the ...
1
vote
3answers
29k views

Can I Deploy a batch file with Group Policy to run as administrator?

I have created a batch script which will block Facebook by amending the hosts file in this location C:\windows\system32\drivers\etc\hosts This is the contents of the batch file: @echo off echo ...