Replace Program Files with Progra~1 in a shell script

最后都变了- 提交于 2019-12-12 00:36:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!