Questions tagged [batch-file]

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

batch files are text files containing commands executed in sequence to achieve a particular task or a set of tasks. They can be very simple, or can contain complex logic.

440 questions
0
votes
1 answer

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 accomplish such a task, could you please point me in a…
0
votes
2 answers

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 via GPO ? If someone wants to suggest a batch…
joebegborg07
  • 869
  • 5
  • 16
  • 24
0
votes
5 answers

IIS wont run a BAT File

The problem we have run into is as follows. We have an ASP.NET WebService which runs under IIS7. The code in the WebService works 100%, however when the WebService tries to run a .BAT file, nothing happens. Nothing at all, the code doesn't crash,…
Kyle Rosendo
  • 149
  • 1
  • 2
  • 9
0
votes
1 answer

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? Of course I can try to find and replace what I…
d.lanza38
  • 357
  • 1
  • 6
  • 13
0
votes
1 answer

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 "C:\Program Files\WinRAR\WinRAR.exe" m…
0
votes
1 answer

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: cmd /c "C:\Windows\system32\wbadmin.exe" start…
Riccardo
  • 253
  • 1
  • 3
  • 13
0
votes
1 answer

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 //Packages/Project/config/cde.txt …
tipu
  • 3
  • 2
0
votes
1 answer

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 it's better to create one batch file on server 5…
eyal
  • 103
  • 3
0
votes
1 answer

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 migration of the clients files from the old XP system,…
BitBug
  • 237
  • 1
  • 5
  • 14
0
votes
1 answer

Batch script to increment the text file ans also the value inside the file

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, content2,...content5. The Foo1.txt should have the…
Sindhuja
  • 9
  • 2
0
votes
2 answers

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 /freezealways This is what is should do first. This works…
Saeed
  • 366
  • 3
  • 11
0
votes
1 answer

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 there are more than 10 established connections, the…
Chris
  • 107
  • 2
  • 8
0
votes
1 answer

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 line. But when I run it from batch file I get the…
0
votes
1 answer

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 have added an IP as 0.0.0.0 at the bottom of all the…
0
votes
1 answer

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 Temp folder. When I logged into the server and tried…
Stephen Last
  • 147
  • 2
  • 8