Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
2 votes

Copy and rename batch file

Save this as RenameThemAll.ps1 and save anywhere on pc(i guess, didnt rly test), then paste whole code in that file, save, right click and Run with PowerShell... -This will ask you what directory you ...
Danijel's user avatar
  • 368
1 vote

How to Extract Part of Variable After Choice

You can use a For /f loop to capture the literal keypress and use it directly. @Echo off Echo([A] [B] [C] [D] Call:GetInput Option abcd If not errorlevel 1 Echo(You Pressed %Option% Pause ...
T3RR0R's user avatar
  • 536
1 vote

%localappdata% and echo %localappdata% returns two different directories

In CMD, if you want to displays the variable or some text, you must use Echo command. more info Echo /? in CMD. echo %localappdata% echo %appdata% You cannot directly input it without Echo to read ...
Mr.Key7's user avatar
  • 608
1 vote
Accepted

Split The Output of PATH Environment Variable

You can use a FOR loop. Save this into BATCH-file (eg. split_path.bat) @echo off rem Get the PATH variable set "PATH_STR=%PATH%" rem Use FOR loop to split and print each path on a new line ...
DrS's user avatar
  • 26
1 vote
Accepted

How to disable the prompt "do you want to stop this program (y/N)" when killing program in powershell

The message is not printed by PowerShell – you are running mvn.cmd, a Cmd batch script, and the message is printed by Cmd (the script interpreter) anytime a .cmd or .bat script is Ctrl-C'd. There is ...
grawity_u1686's user avatar
1 vote

Faster Way To Getting Administrator Privileges Within Windows Terminal

After experimenting, I finally found the faster Via VBScript Modified from: How to request Administrator... @echo off fltmc >nul && goto :Elevated echo Set UAC=CreateObject^("Shell....
Mr.Key7's user avatar
  • 608
1 vote

Back from Elevated Admin to Not Elevated

Update Sudo for Windows Microsoft has released the application Sudo.exe which functions and works similarly to Linux's Sudo. Currently, only available for Windows 11 Insider Preview Build 26052 or ...
Mr.Key7's user avatar
  • 608
1 vote

Windows CMD sort retaining header?

This has some line length limitations but the basic idea is to run a command to get the first line (here the line starting with set does that) and then run a command to get the rest and sort that. ...
G. Grothendieck's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible