Questions tagged [batch-file]
batch files are simple text files executed in a command to achieve a particular task or a set of tasks
441
questions
0
votes
1
answer
323
views
How to run a batch script completely and automatically on event such as sleep/hibernate and shutdown event using task scheduler?
I have written a batch script to perform some folder synchronizing task. I have scheduled the script to execute using task scheduler on events such as sleep/hibernate(kernel power event id 42) and ...
0
votes
0
answers
652
views
How can I remove the first character of a variable from For and Tokens in a batch script?
With a batch script to set variable from For and Tokens and remove the first char:
for /f "tokens=1,2,3,4,5,6,7,8" %A in (
'net user %username% /domain ^|
find "Global Group ...
1
vote
2
answers
1k
views
Restarting a Linux server from a Windows batch file
I've been working on a problem that I was hoping someone with more experience could weigh in on. I've recently started learning about Windows .bat files, and I've been thinking about real-world ...
0
votes
1
answer
582
views
How can I redirect the output of one command in a batch file?
Edit: This question has been answered, please scroll down ⬇️
This question is related to Server Fault because I am automating minifying some web files before deploying them to my server.
So I have a ...
0
votes
0
answers
2k
views
"Invalid drive specification" when copying files
Currently using XCOPY via a BATCH file which I created, in order to copy files over from a client computer to a mounted drive created in Azure.
I have been using the XCOPY function for some time, ...
0
votes
1
answer
170
views
Nagios BAT file not returning correct status code
I've written a batch file for a Windows server to detect whether a particular service is running and if it isn't, return a Critical status back to Nagios. The script works perfectly (as in, it can ...
0
votes
1
answer
2k
views
Group Policy scheduled task for running .bat file applies, but task does not create
I am trying to add a scheduled task to run a batch file that updates / installs software. I created a GPO to create the task, using these settings:
Task Settings
Task settings 2
Task settings 3
For ...
0
votes
1
answer
528
views
Erased System Path Variables
I was writing a batch file that was supposed to automatically set up a computer to receive "psexec" remote commads. Unluckly i didn't really pay attention to what i was writing and i wrote ...
0
votes
1
answer
1k
views
Run batch file to start specific program to open at specific record
I need to be able to run a batch file that opens Access at a specific record. This I can do, but now I need to also run it on either 32 or 64 bit systems.
Our company uses a mix of systems.
This is ...
0
votes
0
answers
200
views
Best Method For Clearing User Data On Shared Windows Device?
I have had a client request that I setup a user account on a Windows device that will clear all user profile data once the account has been logged off. The computer is a shared device that will be ...
0
votes
0
answers
142
views
Why Would a Log File Get Cut Off When Emailed?
I am setting up some local backups of AWS EC2 instances. The backups are set to run overnight via Windows Server 2012 R2 Task Scheduler. The basic flow of each backup is that an rsync copies the ...
0
votes
1
answer
2k
views
running batch file as administrator privilege in clients with gpo(scripts/logon)
I want to run a batch file on all my domain clients via gpo(scripts/logon), but the problem is that to run a batch file, administrator privilege is required.
I wanted to know is there any command or ...
0
votes
3
answers
3k
views
cmd - run a batch file after all other concurrent batch files finish
I have a simple batch file which calls other batch files, it looks like this:
start /b run_part1.bat
start /b run_part2.bat
start /b run_part3.bat
start /b run_part4.bat
run_last.bat // fires ...
0
votes
1
answer
386
views
Looking for a way to replace every instance of a non-zero sized file in a directory tree using a batch file
I am trying to figure out a way to have a batch script overwrite every instance of a non-zero byte file inside of a specific directory and its sub-folders. I'm guessing since I'm looking for a non-...
1
vote
1
answer
7k
views
Batch - Extract string before the specified character
How to get the string before the character hyphen? The following code gets the string after the hyphen. How can I reverse this?
set string=1.0.10-SNAPSHOT
echo %string:*-=%
SNAPSHOT
But I want the ...