windows equivalent of ./ (current directory) [clos

2019-06-28 00:09发布

On Linux when I want to execute some file and use relative path.

For example I want to do something like this:

cd c:\windows
c:\windows>./System32/ipconfig.exe

However what I get is an error message telling me that "." has not been found.

2条回答
成全新的幸福
2楼-- · 2019-06-28 00:30

A period denotes the current directory in Windows.

For your example you would use the following:

c:\> cd c:\windows
c:\Windows> .\System32\ipconfig.exe

Alternately, you could forego the .\ and do it like this:

c:\Windows> System32\ipconfig.exe
查看更多
不美不萌又怎样
3楼-- · 2019-06-28 00:44

Use the correct slash marks and you should be good. Windows uses backslashes as the directory symbol instead of the forward slash. The only caveat to this is if you have to change drive letters. The cd command will change the working directory, but not the drive. To change drives use [drive letter][colon]:

C:\Windows>cd P:\XenApp\Utils    
C:\Windows>P:    
P:\XenApp\Utils>
查看更多
登录 后发表回答