1, How to do a substring in the CMD.exe -- %VAR_NAME:~POS
for example
set name=fingercatecho %name:~6,3%
This will give you a "cat" ;)
2, How to get the input of user as a string?
On windows 2000 or later. It is simple.
set /p answer=Prompt Message Hereecho %answer%
This will give you the input stirng of user.
Windows Command Prompt (.bat) file never suppose to be a powerful shell. But Microsoft really give it more an more power until a real PowerShell came into place.
没有评论:
发表评论