Questions tagged [batch]

A batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter under MS-DOS and Microsoft Windows.

This was the first extension used by Microsoft for batch files. This extension runs with MS-DOS and all versions of Windows, under COMMAND.COM or cmd.exe, which execute its commands, normally line-by-line.

339 questions
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
1 answer

Batch Script for service restart and alerting over email

Please let me know what i am doing wrong in my code. I am trying to check a set of Services starting with specific set of name. And triggering an email if service is in stop state. I have made a loop where in it will traverse. But i am not able to…
Anonymous
  • 5
  • 2
0
votes
2 answers

How to run in background a Linux command in Windows WSL (Ubuntu1804)

In the effort to bring some of the Linux advantages to my customers running Windows 10, I've developed a few bash scripts in order to automate some of their everyday tasks. I use to let them run the scripts through a Windows batch with the following…
Marco
  • 1,709
  • 3
  • 17
  • 31
0
votes
0 answers

Update Group Policy via Batch Script or Powershell Windows 7

I administer about 300 remote computers (all across the country) that are on Windows 7 Pro (32-bit) and I need to change the Group Policy. This is the first time in 5 years I've had to change the GP. I've gone into MMC and used gpedit for that…
BigRedEO
  • 121
  • 5
0
votes
1 answer

Create .txt file with all PC names on domain for WMIC?

I'm wanting to run WMIC to call an uninstall for a certain bit of software, and, I have a working WMIC command, but I don't know how to create a .txt file with all of our computer names. Does anyone know how to do that? I know that the WMIC switch…
user757392
  • 173
  • 1
  • 3
  • 13
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

execute check and repair mysql(wampserver) from a batch file

I'm trying to run check mysql and repair mysql functions in a sql file from another batch file. I get the error as: C:\wamp64\bin\mysql\mysql5.7.19\bin\mysql.exe" "mysql -u root -p < batch.sql" ERROR 1045 (28000): Access denied for user…
Anu
  • 1
0
votes
1 answer

How to hide the java keystore password in keytool scripts

As part of our project, we are pushing in the SSL certificates onto the rich clients which try to establish the connection with SSL based web servers through a windows batch script. This script contains batch statements of the following…
0
votes
1 answer

Alternative to SWARM FTP batch processing?

In a proposed project the plan is to divide large data sets into chunks, expose them by SFTP into a swarm CPU type of LAN cluster architecture for processing of historical numerical and financial data for simulations. Time consuming. What about…
ElHaix
  • 269
  • 3
  • 13
0
votes
1 answer

unable to start service in remote and local machine with sc command and net command

I am trying to start the services using the below SC command and service is not coming up. sc start startliq_2090 output: SERVICE_NAME: startliq_2090 TYPE : 10 WIN32_OWN_PROCESS STATE : 2 …
0
votes
1 answer

Batch script with multiple parameters

I am executing a batch script to perform operations on services in a server. so i am giving a ui to user to select a list of services from a server. i cab perform this operation if user selects only one service. I want to know how to perform if…
Anonymous
  • 5
  • 2
0
votes
1 answer

DOS Set variable only available after execution

I have a very simple script that I want to take a value from a text document (single line, one value) and pass it to taskkill - it needs to be a one liner too so I have: set /p pidtokill=
AskJarv
  • 25
  • 6
0
votes
1 answer

batch file to check cpu and output to txt

I'm trying to write a simple batch file to check the cpu of the computer every 30 seconds and output to txt file with the current time. I want each line to be like: Line1: %time% %cpu% Line2: %time% %cpu% This is what I came up with so far, didn't…
Shlomi
  • 331
  • 2
  • 9
  • 19
0
votes
1 answer

Batch script errorlevel issue with registry key

The script below was written to check whether if teamviewer is installed or not, and for what architecture it will retrieve the ClientID, transform it to decimal and print it to a file. Everytime, whether it's installed or not, the result of this…
André M. Faria
  • 154
  • 1
  • 1
  • 7
0
votes
1 answer

Displaying dirsize in batch file windows server 2012 R2

I'm trying to display the dirsize with a batch file but so far no luck. DU, dirsize gives me a not recognized as an internal or external command error. This is my batch file so far, it displays all the dir's but not the size. dir D:\test\test2 PAUSE…