在 shell 脚本中用 Progra~1 替换 Program Files [英] Replace Program Files with Progra~1 in a shell script
问题描述
我想要一个脚本/命令,将所有出现的程序文件"替换为没有空格的 Progra~1 在 XP 上赢得 Windows shell 脚本
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
在 XP shell 中有没有办法做到这一点?我一直在搜索,找不到任何例子须藤当前_路径=%路径%NEW_PATH= 用 Progra~1 替换所有程序文件"
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
然后我将使用 setx 来设置新路径
I will then use setx to set the new path
推荐答案
您可以在脚本中使用下面的简单 dos 命令
You can use the simple dos command below in your script
设置 p = %PATH%设置 CLEAN_PATH=%p:Program Files=Proga~1%回声 CLEAN_PATH
set p = %PATH% set CLEAN_PATH=%p:Program Files=Proga~1% echo CLEAN_PATH
这篇关于在 shell 脚本中用 Progra~1 替换 Program Files的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!