0

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

Shawn Vader
  • 12,285
  • 11
  • 52
  • 61

1 Answers1

0

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

Shawn Vader
  • 12,285
  • 11
  • 52
  • 61