All Questions
Tagged with environment-variables cmd.exe
75
questions
0
votes
1
answer
58
views
%localappdata% and echo %localappdata% returns two different directories [closed]
I'm having some issues with Windows 10. After fixing my temp INET folder which somehow was pointing at a different account, I've now found an odd issue.
If I type echo %localappdata% in CMD, it gives ...
-2
votes
1
answer
39
views
In there some description of all the command processor macros in Windows?
I'm looking for a list of the macro strings known to Window 10 command processor, e.g. %ProgramFiles%, %ProgramFiles(x86)%, etc.
4
votes
2
answers
447
views
How do I persist windows variables set in a CMD file?
in windows I would like to have a cmd script that I can run which sets an environment variable. The variable should still be set after the script executes. The variable is a token of sorts and is ...
2
votes
1
answer
396
views
Node wont run from cmd unless the .exe extension is added
So this is a very weird one. Let me start by saying that things used to work fine.
I installed Node a few days ago and once complete I opened a command prompt (On Windows 10), I entered node --version ...
0
votes
0
answers
122
views
Why does adding a filetype to PATHEXT cause invocations to say "Access is denied"?
My goal: to run a file hello.py on my %PATH% when I write hello.
What I've done:
Made sure .py is part of PATHEXT.
C:\Windows\System32>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;....
0
votes
0
answers
42
views
What happened to this added directory in environment variables path?
Added the following directory to the path by using this method:
set path=%path%;D:\Programm\jflex-1.8.2\jflex-1.8.2\bin
set path=%path%;D:\Programm\jflex-1.8.2\jflex-1.8.2\bin\jflex
but, I can't find ...
0
votes
3
answers
1k
views
How to run apps from Windows' command line like in Linux
Context: I use Fedora GNU/Linux as my main OS, but sometimes I need to work within Windows.
Over the years, using Linux distros, I have become used to working mainly through the command line, calling ...
1
vote
1
answer
130
views
Why the path(enviroment variable) is different between show in the cmd and the system property?(Windows10)
Before the question show, i use cmd order path = %path%D:\test to add a root in PATH(eniroment variable).When i use cmd order echo %path% , it shows:
D:\VMware Workstation Pro\bin\;C:\Program Files\...
0
votes
1
answer
975
views
Run script on windows startup with environment variable
Windows should run a script on startup that starts a DB based on an environment variable %SAPSYSTEMNAME%:
net start SYBSQL_%SAPSYSTEMNAME%
When i run this command in my cmd it works fine, however on ...
0
votes
2
answers
654
views
Erased System Path Variables
I was writing a batch file that was supposed to automatically set up a computer to receive "psexec" remote commads. Unluckly i didn't really pay attention to what i was writing and i wrote ...
1
vote
0
answers
17
views
What does the start command actually do? [duplicate]
Suppose I want to launch a program from the cmd (or windows powershell). If i simply type the name of the executable of course nothing starts, as my shell does not know where to find the .exe that I ...
0
votes
2
answers
5k
views
How to call programs from cmd directly without adding their paths to PATH variable on windows?
Suppose I installed a new package with someProgram in it:
myNewPackageDir/bin/someProgram
If I want to accessing it from cmd using only its name (example: someProgram --option1 a --option2 b --option3 ...
0
votes
1
answer
466
views
How using SET command with a call to CMD.EXE? [duplicate]
I have to create system variable in Windows through calling CMD.Exe.
I try :
cmd.exe /C maVar=maVal
Saddly, no maVar is created.
If i open CMD.Exe and type :
maVar=maVal
-> maVar is created.
...
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, ...
4
votes
2
answers
1k
views
PATHEXT environment variable not working
I want to use gcc on Windows, so someone gave me a MinGW folder. I put the D:\software\MinGW\bin\ folder in my PATH. But when I open a new CMD and type gcc, I get
'gcc' is not recognized as an ...
0
votes
1
answer
222
views
how to find out what shortcut is used for a application by start command in cmd windows? [duplicate]
How does application (any) make its shortcut for launch in installation? For example c:\>start calc will launch windows calculator, but I have no idea where is located the executable calc.exe and ...
0
votes
1
answer
1k
views
How can I run a batch file in an isolated environment? [closed]
Changes to the environment made by a batch file persist in the calling cmd.exe's environment.
Assume set.bat:
SET MYVAR=42
Then in cmd.exe, I type and see:
C:\Users\Me>.\set.bat
C:\Users\Me>...
0
votes
1
answer
281
views
Why clearing PATH in windows CMD prompt makes it close immediatly?
Consider these 2 versions of a cmd script.
First Version (overrides PATH)
set PATH=%USERPROFILE%.cargo\bin;%USERPROFILE%.rustup;
%~d1
cd "%~p1"
call cmd
Second Version (add some path to ...
1
vote
1
answer
176
views
%PROMPT% variable resolved differently if set directly in CMD or by Windows variables tool
When trying to customize my command prompt I faced a strange behaviour:
from the CMD the line
SET set prompt=$D $T$H$H$H$_%USERNAME%@%COMPUTERNAME%$_$P$G
works as expected:
28/05/2020 12:02:15
DDS@...
1
vote
1
answer
2k
views
Windows: How to save a variable -(input: path) to text file
I'm trying to save a variable to text file, but i'm failing:
:folder
echo. && echo Where is your folder ?
set /p userinputpath = Type input[Drive][Path]:
echo "%userinputpath%" >> ...
1
vote
1
answer
1k
views
Windows 10 command prompt is not recognizing any basic commands
I have read forums, but have not found anything useful about what to do, with someone suggesting it might be with my PATH variable, but I don't know how to fix that.
Output of ipconfig:
Output of ...
2
votes
0
answers
220
views
Python and Perl not recognized in cmd even after adding in environment
It was fine yesterday, but it suddenly stopped working today.
Both my perl and python were not recognized in cmd. I read as much as i can online for the answers and follow the instruction. I have ...
2
votes
0
answers
27
views
impossible to open .bat files by double clicking: can't find file [duplicate]
My problem is that when i double click a .bat file it doesn't get opened by cmd and i get this error message:
"Windows cannot find 'C:\users\ (my name)\Desktop\test.bat'. Make sure you typed the ...
2
votes
1
answer
433
views
How Does py Launch Python3 on Windows Command Prompt
Im trying to understand how python get's launched from the command prompt with the "py" syntax. From my understanding, an environment variable is created, allowing python.exe to be executed from the ...
0
votes
1
answer
402
views
WMIC Output Result Without Property Name
I'm entering this line:
wmic /OUTPUT:D:\DriverVersion.txt path win32_VideoController get driverversion
The txt file has two lines in it:
VariableValue
XX.XXX.XXX.XX.X
But I don't want ...
1
vote
1
answer
5k
views
How to add to SYSTEM "PATH" environment variable in windows 10 via cmd, not to user's one?
By using setx "%path%;c:\whateverFolder I just copy system path variable to users one, therefore duplicating it, and only after it the required folder is added. Is it possible to add it to SYSTEM path ...
0
votes
1
answer
2k
views
system variable not set on remote machine by psexec
Need to set-up system variable on remote machine. Performing
psexec \\remote_machine cmd /c setx foo bar
got reply
Success: Entered value was saved
cmd exited on remote_machine with error code 0
...
3
votes
2
answers
11k
views
youtube-dl 'youtube-dl' is not recognized as an internal or external command, operable program or batch file
I have already added the path to environment path variable.
But when I tried to execute it through cmd . I am getting the error
'youtube-dl' is not recognized as an internal or external command,
...
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 ...
0
votes
0
answers
38
views
Setting an Environment Value in a FOR Loop [duplicate]
I wrote this code:
set list1=This,Is,A,List
set list2=
FOR %%c IN (%list1%) DO set list2=%list2%-%%c
I expected list2 to equal -This-Is-A-List, instead it equals -List. I have verified that it is ...
9
votes
2
answers
13k
views
Set and print content of environment variable in cmd.exe subshell?
Consider this example, where I start a new "sub" instance of cmd.exe, and then try to set a new environment variable in it, and then check if it has the proper value set (this is in cmd.exe of Windows ...
2
votes
0
answers
141
views
Windows 10 Environment Variables: why does variable replacement not work?
On Windows 10 Pro:
I just downloaded and installed (i.e. unpacked) the latest Maven version into a directory in preparation of an upcoming development project. Then - as instructed - I defined me two ...
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 ...
0
votes
0
answers
49
views
Command prompt. Is it possible to create a certain number of variables according to the lines in a text file and then
Can we use a text file to set variables according to how many changing lines are there in the .txt file?
files.txt
name 1
text 2
info 3
... and so on
set line01="name 1"
set line02="text 2"
...
0
votes
1
answer
2k
views
pip command error during installation of requirements.txt
When I run the command py -2.7 -m pip install requirements.txt, I'm getting the error
but I have already upgraded it
but I'm still getting error in installing requirements.txt.
When I use the ...
2
votes
1
answer
4k
views
How to override environment path variable to call curl from custom path instead of system32 path?
I have a path for folder containing curl.exe file (C:\My\Custom\Directory\) added to Path Environment Variable. The problem is that when I call curl from command line, it runs another curl executable ...
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\...
0
votes
2
answers
1k
views
Trying to use an environment variable in a .cmd script, getting the message "\Windows was unexpected at this time"
I need to access a windows environment variable in a .cmd script, it looks something like this, following the documentation on microsoft's support:
if "%MY_ENV_VAR%" == "" (
echo You must set your ...
2
votes
0
answers
433
views
Unset environment variable starting with =
I have this stange environment variables in my windows (discussed here and here):
C:\Users\******\Desktop>set ""
=::=::\
=C:=C:\Users\******\Desktop
Unfortunately, I have to run a software that ...
3
votes
0
answers
2k
views
How can I set a dynamically evaluated environment variable for Windows' Command Processor (cmd.exe)?
The Windows command processor (cmd.exe) supports environment variables like USERNAME and USEPROFILE. The value of these variable is always the same after they have been set. But if I execute echo %...
7
votes
2
answers
3k
views
How do I keep each PATH entry only once?
I have just tried to add something to my PATH and realized it grew out of proportions because of duplicates:
C:\Users\user>setx Path "%Path%;C:\Python34"
WARNING: The data being saved is truncated ...
0
votes
1
answer
497
views
CMD: SET : SETX :: %ABC% : ??? -- Getting "global"/"original" ENV after altering by SET
SET "temporarily" sets/changes an environment variable.
How do I get the "original" / "global" / "unchanged" one from a shell/process in which it has been ...
0
votes
2
answers
97
views
Different behaviour of cmd depending on the form of the path string
In cmd window I can't cd to a directory if it is set by a user environment variable. The variable content is OK.
If I cd to the directory set by the content of the variable, it works OK, too.
Could ...
1
vote
1
answer
232
views
Can I use a batch file to hilight a specific file format?
I've been experimenting with batch files lately, and recently I found an answer to an old question: Hilight/select a file with a batch script. Now that I have accomplished that, I would like to know ...
1
vote
1
answer
2k
views
Why some libraries are loaded only under administrator privileges?
On Windows, I have an executable that depends on some third-party libraries.
If I try to run it under cmd, an error windows appear saying "program can't start because some_third_party_library.dll is ...
0
votes
0
answers
92
views
Windows: Remove file type from path completion
I've got an issue with my cmd environmental variables autocompletion (with TAB). For some reason, I'm getting suggestions for .dll .png and all other nonsense I don't care about. How do I exclude ...
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 ...
4
votes
2
answers
9k
views
Write multi-line variable to .txt (CMD, NO .bat)
I'm successfully splitting %PATH% into multiple lines like this
set t=%PATH:;=^&echo.%
then this displays each path in new line nicely, just as I want:
echo %t%
However when I want to write ...
0
votes
2
answers
1k
views
Directory path in environment variable as argument to CMD command DIR
How can a Windows/CMD environment variable be used as argument to CMD's builtin dir command?
>echo %pythonpath%
C:\Program Files\Python35\Scripts\
>dir %pythonpath%
The system cannot find the ...
2
votes
1
answer
3k
views
Does Windows7(+) have the env or equivalent? (Env. variable for single run of application) [duplicate]
I'm looking for an opportunity to launch an application (eg, compilers) with specific environment variables . I want same functionality like env in Linux.
env var=value application.exe
I found ...