Skip to main content

Questions tagged [batch]

Batch processing is the execution of a set of commands or software programs without user intervention. A batch file is a text file containing a sequence of such commands or programs invocations. Please use the tag [batch-file] for that.

0 votes
2 answers
179 views

How can I make a custom utility library with functions that will be callable from windows cmd?

How can I make a custom utility library with cmd/batch functions that will be callable from a windows cmd terminal? You can make functions in a batch file, for instance: @echo off goto :main :...
Qwert Yuiop's user avatar
0 votes
0 answers
507 views

Change Regional Format

What is command to change regional format to other region with Batch script? If in powershell, i do this with: $GID=111 Set-WinHomeLocation $GID
Mr.Key7's user avatar
  • 843
0 votes
1 answer
66 views

Get TimeZone Display Name Batch Script

Batch code: @echo off for /f "tokens=1*" %%a in ('TZUTIL /g') do set TZID=%%a %%b SetLocal EnableDelayedExpansion for /f "tokens=1-4" %%a in ('TZUTIL /L') do ( set $U=%%a& ...
Mr.Key7's user avatar
  • 843
0 votes
0 answers
33 views

scheduled batch file stops running and reports error

I have a batch file that contains the following line: @robocopy E:\ G:\ /DCOPY:DAT /xd $* syste* /xf ~* /s /xo /np /copyall /log:c:\back-EG.txt It is scheduled to run on the first day of month. I ...
joehua's user avatar
  • 297
0 votes
1 answer
81 views

In batch code, how to make an input choice instead of typing?

Currently, I list all network adapters, and then the user needs to type the name of an adapter to proceed with the rest of the code. :: Listing all network adapters echo/List all network adapters &...
Rootz's user avatar
  • 15
3 votes
3 answers
689 views

Set Variable in one line Batch

set var1=Demo set var2=%var1% echo %var2% rem Output:Demo Why does set var2 below not work if in one line with set var1? set var1=& set var2= set var1=Demo& set var2=%var1% echo %var2% rem ...
Mr.Key7's user avatar
  • 843
1 vote
1 answer
51 views

Get some spaces in a Batch

In PowerShell: $val = ' ' $val *=5 write-host "[$val]" The Output is 5 spaces: [ ] But in Batch: set "val= " set /a val*=5 echo [%val%] The Output is zero: [0] How i can get ...
Mr.Key7's user avatar
  • 843
0 votes
0 answers
37 views

Send input to running program Batch

I would like to start a cmd line program in Batch and be able to communicate with it. Currently I am starting the program with start /b cmd /c "cli_program.exe" > log.txt. I am currently ...
octalgon's user avatar
2 votes
1 answer
62 views

Get Highest Value from String Batch File

Batch code: set list=4 8 1 for %%a in (%list%) do set highest=??? how can I get and save the highest value into a variable?
Mr.Key7's user avatar
  • 843
0 votes
0 answers
59 views

How to align spaces in CMD code output

My Batch code: @echo off set phones="iPhone 12" "Galaxy S5 4G" "Nokia 7" set manufs=US "South Korea" Finland SetLocal EnableDelayedExpansion set n=& for %%a ...
Mr.Key7's user avatar
  • 843
0 votes
1 answer
125 views

Batch script and get the output value of a found key

All works fine in a CMD prompt, but, I need put in a bat file to run, but cannot get the output of the Reg Query cmd, and then run another query from that. Since what I am looking for is an App ID, ...
LuckyCharms's user avatar
1 vote
1 answer
38 views

How do I show parts of a string?

@echo off set keys=_ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 SetLocal EnableDelayedExpansion from keys above, command echo !keys:~1,1! output A, command echo !keys:~4,1! output D. my question: How do I ...
Mr.Key7's user avatar
  • 843
2 votes
1 answer
210 views

How can I check that files match a list of MD5 checksums on Windows 10?

I downloaded a large number of files via this magnet link (Apache 2.0 license), then moved the files around between a few devices. I now want to check the integrity of the files. A file lists MD5 ...
Franck Dernoncourt's user avatar
0 votes
1 answer
83 views

Batch file running in one account but not another

I wrote a batch file to run a schtasks for a Windows 7 Home machine. When I tested it in my account (standard user), the script runs correctly, but when I migrated the script to the account (also ...
Eliezer Meth's user avatar
0 votes
0 answers
30 views

Trying to find .exe over multi drive wide search in a bat file. Tried with relative path commands

As stated in the title I have a bat file set up to locate and run 2 separate exe's. One is located in the same folder as the bat file which for this %~dp0 works just fine. The second exe is one to a ...
heyimvic's user avatar

15 30 50 per page