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

1
vote
1answer
13 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
28 views

Windows batch file not continuing

I am trying to write a script that stops a service then zips the contents of a directory and copies it to my network drive. The script below stops the service but then dies. net stop MSSQL$time if ...
0
votes
0answers
25 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
votes
0answers
15 views

How to monitor my scheduled tasks? [closed]

I have created batch files to run my jar files(java applications). Then I have created scheduled tasks for my batch files and Its running on my windows server 2008 perfectly. Now I just want to ...
1
vote
1answer
11 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
30 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
19 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
57 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
36 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
256 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
151 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
19 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
86 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
31 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
454 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
21 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
47 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
74 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
57 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
56 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
46 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
195 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
647 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
310 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
719 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
379 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
107 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
175 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
1k 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
142 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
510 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
216 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
50 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
134 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
440 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 ...
0
votes
0answers
66 views

“Password Expired” when attempting to access Win7 machines on local network with our local admin account

Looks like all of our Win 7 and Win 8 machines were somehow set to expire the admin account that we created locally a couple months back. Now we're trying to make sure we either have to go to ...
3
votes
1answer
679 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
0answers
30 views

Error Reporting for File Copy Process

I have a rather complex process in place which runs a java program to retrieve service records from our CRM and export them into an excel spreadsheet, which gets placed onto a server in our data ...
0
votes
1answer
56 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
495 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
507 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
44 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
562 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
227 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
7k 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
292 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
297 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
288 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
2answers
23k 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 ...
2
votes
1answer
914 views

dsadd run from batch file fails with “The specified account already exists” when there is no existing account with the same dn

I am programmatically creating thousands of test users from a txt file containing First Name, Last Name, Username, and Password using the following command (saved as a batch file, run in cmd, modified ...