mIRC Home    About    Download    Register    News    Help

Print Thread
#206444 15/11/08 02:23 PM
Joined: Jul 2006
Posts: 248
B
bwuser Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
Hello, I did a script to rename some files but the /rename command won't work. I assume it's because of the spaces in the filename but not even with "'s it works.

the script's order I use is:
rename " $+ %file $+ " " $+ $nofile(%file) $+ z $+ %rename $+ "

if I echo it, gives:
rename "F:\musica\nueva carpeta\adema - everyone.mp3" "F:\musica\nueva carpeta\zAdema - everyone.mp3"

and the message I get is:
Finished! "F:\musica\nueva files scanned, 0 files renamed.

even if I manually try to rename with //rename "F:\musica\Nueva carpeta\adema - everyone.mp3" "F:\musica\Nueva carpeta\zAdema - everyone.mp3" it won't work..


why is this?

thanks

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Well it's hard for us to guess because you haven't given the error message provided by the /rename command itself, you've only provided some scripted message which really doesn't help.

It's possibly a problem with multiple consecutive spaces in the original filename. Whether there's a way around it really depends on where the filename is coming from. If it's coming from $sfile() use $shortfn($sfile()). If it's coming from $findfile() you can use the .shortfn property.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Jul 2006
Posts: 248
B
bwuser Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
Finished! "F:\musica\nueva files scanned, 0 files renamed. -> is the message I get from the /rename, not from my script. It happens when I try to rename from my script and if I try it manually with //rename "F:\musica\Nueva carpeta\adema - everyone.mp3" "F:\musica\Nueva carpeta\zAdema - everyone.mp3"


From what I see it asumes the filename stops with the first space, even if its between "". That's what needs to be corrected, I tried to rename the files using $shortfn but didn't work either frown

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
It seems clear that you have a /rename alias that's causing your problems. Try using /!rename instead and it will almost certainly work fine.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Jul 2006
Posts: 248
B
bwuser Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
Wow, yes, that was it. I had another script running with a "rename" alias mad

Now it works perfect.
Thanks, I would've never guessed it laugh


Link Copied to Clipboard