All Questions
Tagged with environment-variables cmd.exe
10
questions
3
votes
2
answers
10k
views
What is the default value of the PATHEXT environment variable for Windows?
What is the default value for the PATHEXT environment variable for different versions of Windows? Or even better: How can you reliably determine the original default system value for PATHEXT on a ...
2
votes
0
answers
907
views
Powershell can't see "git" or "node" commands while cmd can
Using Windows 10, I can't run certain commands from PowerShell but they all work correctly using cmd.
PowerShell:
node --version:
node : The term 'node' is not recognized as the name of a cmdlet, ...
15
votes
1
answer
25k
views
Why unload variables in Windows batch files
Is it considered necessary or good practice to unload variables used in Windows batch files?
For example in the following code, is the set myFolder= at the end necessary?
@echo off
set myFolder="C:\...
8
votes
1
answer
21k
views
Enable-WindowsOptionalFeature is not recognized in Windows 10
When I try to run Enable-WindowsOptionalFeature windows throws ''Enable-WindowsOptionalFeature' is not recognized as an internal or external command,
operable program or batch file.'
I am running ...
8
votes
7
answers
28k
views
WMIC output property value without property name
I'm entering something like that
Desktop>wmic environment where(name="PATH" and systemVariable=FALSE) get variableValue
VariableValue
xxx
But I don't want VariableValue to get into output. I want ...
2
votes
1
answer
8k
views
Windows CMD reset PATH variable to default
I have a question that someone surely must have come across, but maybe I'm not using the right search terms.
I wish to reset the PATH variable in a command prompt to the default.
So, for example, I ...
2
votes
5
answers
14k
views
How to set the arithmetic precision in "set" batch files variables?
How do I set a precision to the SET arithmetic operation on divisions?
eg. SET /A t=3/4
But that gives result as '0' and not '0.75' ( I want at least 2 decimal places )
Or is there any other ...
2
votes
1
answer
2k
views
Why doesn't environment variable get updated in cmd without restart?
CMD commands:
setx SOMEVARIABLE "newpath" /M
setx SOMEVARIABLE "%SOMEVARIABLE%;newpath2" /M
Expected output on ECHO %SOMEVARIABLE%:
newpath;newpath2
Actual output:
%SOMEVARIABLE%
Actual value ...
1
vote
1
answer
460
views
Batch script to take the output of a command and create a variable out of it?
For example, I want to search for a file
where /r C:\ "myfile.txt"
and then make the output of that command which would be the file path to "myfile.txt" a variable I choose,
So then the path to ...
0
votes
3
answers
4k
views
how to use output as VARIABLE and put trimmed value into CLIP?
can anyone teach me the right way? here is my attempt code:
@echo off
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
"%~dp0..\x64\mediainfo.exe" --Inform=General;%%UniqueID/String%% "%~dp0..\files\...