问题
I would like to have a script/command that will replace all the occurrences of "Program Files" with the no space Progra~1 win a windows shell script on XP
Is there a way in the XP shell to do this? I have been searching and can't find any examples sudo CURRENT_PATH=%PATH% NEW_PATH= replace all "Program Files" with Progra~1
I will then use setx to set the new path
回答1:
You can use the simple dos command below in your script
set p = %PATH% set CLEAN_PATH=%p:Program Files=Proga~1% echo CLEAN_PATH
来源:https://stackoverflow.com/questions/11012963/replace-program-files-with-progra1-in-a-shell-script