[Windows] Editing a string in CMD script?
Posted: January 27th, 2012, 9:43 am
I'm using the following cmd PP script to update my XBMC lib and also pass the downloaded item's name into a php script which does several things such as create an RSS feed, send a notification to XBMC (A pop-up) and a few other bits.
The problem I am having is with items with spaces in their names.
I need to somehow replace the spaces in the %3 veriable passed in the cmd arguments with a '+'.
Here's my script:
I found the following code on how to replace characters in strings but it didn't seem to work:
What I tried was:
Anyone able to give me a hand here?
Once I get this working properly, I'll move the XBMC update line into the php. I've left it there atm as calling the script sometimes fails due to this issue.
Thanks.
The problem I am having is with items with spaces in their names.
I need to somehow replace the spaces in the %3 veriable passed in the cmd arguments with a '+'.
Here's my script:
Code: Select all
c:\curl.exe http://192.168.0.2:7076/xbmcCmds/xbmcHttp?command=ExecBuiltIn(XBMC.updatelibrary(video))
c:\curl.exe http://localhost:1458/add.php?name=%3
Code: Select all
set str= word &rem
echo."%str%"
set str=%str: =%
echo."%str%"
Code: Select all
set newName=%3: =+%
Once I get this working properly, I'll move the XBMC update line into the php. I've left it there atm as calling the script sometimes fails due to this issue.
Thanks.