How can i make a custom dos command like cp/md/ren etc
i am using c# language to build a console application. My target is i have to build a custom command like "do pfizer.text" and it'll create a file "phizer.text" on desktop.
I know i can do this with existing commands but i want to make my custom command ( "do" in this case).
Can anyone tell me how开发者_开发知识库 to do this ??? I will prefer c# language as solution language.
Thanks, -seoul.
Just create your own console application with the name of command. Place this application on any folder included in %PATH%
OR add your folder path to the %PATH%
.
To check current paths -
- Open cmd
- Type
path
To add new path -
- Open cmd
- Type
set path="%path%;c:\mypath\"
The command line (not DOS for a long while now) will search for executables or scripts in all folders defined on the %Path%
system variable. By adding the path of your program to that variable you can start it from anywhere.
You can find these variables at the System Properties dialog:
(source: vlaurie.com)
精彩评论