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

passing exe to non-admin user outside network to install software

I'm in a dead end now and need your help. I tried everything I could find on the web, but didn't succeed. I have hundreds of non-admin domain users working on their Windows 10 laptops outside our network with no VPN connection to the domain. I need…
rui
  • 25
  • 1
  • 7
0
votes
0 answers

Scheduled task returns error 0xff but success

I have a scheduled task that runs a batch file, and even though I can see the results of it completing successfully, according to the task scheduler it fails with error 0xff, every time. title Archiving for /f "tokens=2 delims==" %%a in ('wmic OS…
0
votes
2 answers

remotely destroy all data windows 7

we are downsizing our organization and closing several stores. This may sound malicious but actually involves complete remote data destruction for company equipment. My team has been tasked with remote destruction of all data, including the windows…
0
votes
1 answer

Running batchfile admin to set envirnment var

I am running into an issue here on Windows 10. I am trying to set an environment variable within the batch file using a for ... in ... do, but it never finds the file folder I am looking for. example: cd \temp for /f "delims=" %%a in ('dir /b /ad…
Mike
  • 1
  • 1
0
votes
1 answer

Batch: Passing 'Enter Key' into Nested Programs (Program Ran by MPIExec)

What i need: To send "enter" key when batch is still processing a previous line. I am trying to use batch to have an .exe run through a series of input files. The batch file below runs a program, creates an output file, copies it, and then cleans…
0
votes
1 answer

can you sum within a function or use '!' within '!' in cmd?

Having some difficulty with the delayedexpansion in cmd. This might be a stupid question but is there any way of summing within a function (ie without 'set') or using ! within ! (or something to the same effect); for example could ~%%n+%y% in the…
0
votes
0 answers

How to delete all files and subfolders older than 5 days by cmd call

I use Windows. I want to delete all files and subfolders older than 5 days by system call. I have this command, but i want to delete all files and subfolders older than 5 days. FOR /D %i IN (C:\mydir*) DO RD /S /Q "%i" DEL /Q C:\mydir*.* Do you…
0
votes
1 answer

Copy files and folders by specific days of the month

I'd like to create a batch file to copy the files and folders by specific days. For example, 15th and 30th of the month(not 15th to 30th) copy the files and folder to another location. How can I write this script with xcopy or robocopy…
fedora
  • 11
  • 5
0
votes
1 answer

Installing operating system from server PC to all the client PC

I am working on the project in which I have decided to install operating system from server PC to all the client PC. I have one windows iso file on the server PC which is shared on the network. This iso file will be first transfered or copied to…
DKB
  • 27
  • 2
0
votes
1 answer

Scheduled powershell to replace batch file ends too soon or never ends

First I'll explain the context, because maybe I'm not doing it in the right way. We have an ERP developed using Oracle Forms 6i (yes, is really old). It has forms and reports. Reports have such complex queries that when run with ample dates the…
EAmez
  • 101
  • 6
0
votes
1 answer

Pass PIDs from tasklist and kill processes with tasklist WITH spaces in the name of the process

So this question is VERY similar to this question, with this answer. But some of my processes have a space in the name, and CMD returns nothing. My original question has been answered in this answer, this question is asking how would I do this, but…
0
votes
1 answer

Batch file match start of machine name

What I need to do is add a few lines to an existing batch file so that it acts differently depending on the machine name. We have a standardised naming scheme where the first three letters of the machine name indicate the machine type and location.…
GAThrawn
  • 2,434
  • 3
  • 20
  • 38
0
votes
4 answers

How can my my batch file determine whether I'm on my work network?

I have a batch file that runs whenever I log in on my laptop. I only want the batch file to execute when I'm on my employer's network. At home, I'd like the batch file to simply exit. What's an easy way to detect (from a batch file) whether I'm on…
Jeremy Stein
  • 307
  • 1
  • 5
  • 14
0
votes
2 answers

Find string in command result

I want to do following in a bat file Run a exe Capture results from step 1 find a string in results from step 2 if step 3 find is successful then do something Is this possible(particularly worried about the find part)? Any help is appreciated.…
tugga
  • 113
  • 4
0
votes
1 answer

Q: How do i Activate Robocopy with /B (or /ZB) Flags?

Robocopy is failing when it is activated by clicking on my "run_bckup.bat" file. Although the batch file has Admin-privileges, the following line fails: Robocopy "%src%" "%trgt%" .. /B .. But starting the DOS-Window (open as Administrator) &…
Uri L
  • 11
  • 3