2017年1月25日 星期三

customize command in fileExplorer address bar

you can run command like
cmd/ powershell/ notepad in window file explorer address bar
but it is possible to run more complex command in that address



1.add a directory for your batch files
eg: "D:\MyUserName\CmdShorCut"

2.add the directory to system environment
add D:\MyUserName\CmdShorCut to PATH system environment, if there is already something in PATH add our path after the original context and separate them by ";"

3. add .bat file in the directory we just created
eg: I'd like to run powershell by a command ps
add a text file ps.txt contain:
powershell %*
that's all. %* means all the parameters you give when you run this .bat file. Rename ps.txt to ps.bat.

4.Now you can run ps in address bar

沒有留言:

張貼留言