Current directory and parent directory seem broken - shell

I have Windows 8.1 and I have a strange problem.
When I launch a Command Terminal, it seems that current directory and parent directory don't work when I try to use it to launch executable.
For example, considering the following folders :
C:/dirA/dirB/program.exe
C:/dirA/dirB/dirC
I put dirA/dirB in the PATH variable.
So, when I launch program.exe in Command Terminal, it works.
But, if I go in C:/ and launch the following command :
./dirA/dirB/program.exe
I got the following error :
'.' is not recognized as an internal or external command, operable
program or batch file.
Error is the same if I go on C:/dirA/dirB/dirC folder and launch the following command :
../program.exe
Error is :
'..' is not recognized as an internal or external command, operable
program or batch file.
So, I don't understand what is the problem and how to solve it. Someone have an idea and can help me ?
Thanks for your help.
Sylvain

If you want to use forward slashes (/) with paths in Windows Command Prompt you need to quote the whole path.
"./dirA/dirB/program.exe"
If you use backslashes (\) then you don't have to quote paths (unless your path contains spaces).

Related

g++ is not recognized even thought my PATH variable has been updated

I'm at my wits end here. This is what I get when I type "echo %PATH%" into cmd:
C:\Users\user>g++
'g++' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\user>echo %PATH%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Wind
owsPowerShell\v1.0\; C:\MinGW\bin\;C:\Users\user\AppData\Local\Programs\Python\P
ython39\Scripts\;C:\Users\user\AppData\Local\Programs\Python\Python39\;C:\Users\
user\AppData\Local\Programs\Microsoft VS Code\bin; C:\MinGW\bin\;
C:\Users\user>
I've tried everything. Of course i'm using new cmd instances to check. Restarting doesn't work. I can go to the C:/mingw/bin directory and open g++ just fine with cmd once there. I've tried all the different formatting with the PATH variable: The 'C:' part, semi colon at end, backslash at end. No permutation works. You can see in the output above that both my user and system path have the correct directory for g++.
UPDATE: Ok I just tried updating only one user/system path at a time. I get the 'This app can't run on your PC dialogue' (windows 8.1) and at returns 'access denied' now. But when I run the cmd as admin it works!
But still VScode returns
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Cannot create temporary file in C:\Users\user\AppData\Local\Temp; C:\MinGW\bin\g++.exe\: Invalid argument
now

'gradle' is not recognized as an internal or external command, operable program or batch file

I've just installed Gradle, I tried putting in the Environment Variable so Windows will know where to look for Gradle. I believe I've done everything by the book. But when I type, Gradle -v, I get the message:
'gradle' is not recognized as an internal or external command, operable program or batch file.
So I made a video where you can experience what I am. I have no idea what is wrong???
My video of the problem
You have append path to the 'Gradle.exe' to the end of the %PATH% variable and restart computer.
If program name without full path is entered in windows shell, it try to look into the %PATH% variable and check all listed paths. If not successfull, than print message you got.

Error when i run a shortcut using it's path in cmd

I have a problem whenever I try to run some paths,
for example :
C:\Users\Dell\Desktop\Menu\program.lnk
I had this error:
not recognized as an internal or external command operable program or batch file.
As you can see this not a problem of space in the path, how can I solve this?
Having Tested This in the command prompt myself I found that on my windows 7 machine the command prompt doesn't like me appending the '.lnk' file extension on the end yet it seems to work to when I remove it. Other than I am not too sure. Could be a problem with the shortcut or the executable but I doubt it.
i just had to add cmd /C as prefix of the command

Run Multiple commands in a single line in windows command prompt

When I execute the following commands separately i can get the information of the mnc file
C:>set path=%path%;C:\Program Files\MINC\bin
C:>mincinfo image.mnc
But I want to run it in a single line. So i tried this as
C:>set path=%path%;"C:\Program Files\MINC\bin" && mincinfo image.mnc
But it gives the following error,
'mincinfo' is not recognized as an internal or external command,
operable program or batch file.
Is there something wrong in my commands? Please help to solve it.
You can of course specify the full path of the program to execute, without needing to add it to the PATH variable.
C:>"C:\Program Files\MINC\bin\mincinfo" image.mnc
if you concatenate your commands with &&, the whole line will be parsed at one time.
The result is, the path is yet the old path for the second command.

Where does windows cls.exe reside?

As we know windows CMD can clear the scren by cls.exe command. But I cannot find the command location.
Usually, I can use which to find the location of the command program file.
But for cls.exe, it does not work, and displays as:
which: no cls in c:\Windows\System32...
Could you guys help me how cmd works? I searched on the internet, only finding clues on how to use it. Not how itself works!
There is no cls.exe. 'cls' is an CMD.EXE internal built-in.
It's built-in command to cmd.exe and not a stand-alone program.
i.e. cls.exe does not exist:
C:\>"cls.exe"
'"cls.exe"' is not recognized as an internal or external command,
operable program or batch file.
C:\>"cls.com"
'"cls.com"' is not recognized as an internal or external command,
operable program or batch file.
C:\>"find.exe"
FIND: Parameter format not correct
The last one, find.exe, is just there to show what happens when it exists.

Resources