I want to run 7zip on a selected archive in windows explorer via a keyboard shortcut.
I am trying to split the path for the selected file/folder such that I can surround the path components which have spaces in them with quotes - so 7zip can work.
For eg,
C:\Documents and Settings\Administrator\Desktop\converber.zip
Here, I need to parse and then change the relevant part to ---
C:\"Documents and Settings"\Administrator\Desktop\converber.zip
The code I wrote is below, but I am getting stuck because I cant add the \ to the regenerated string?
Sorry if the mistake is stupid, but I cant solve it!
Please help!!
Code:
BlockInput, Mousemove ;Block mouse movement
clipboard=
send, ^c
ClipWait, 0.5
filename=%clipboard%
clipboard := oldclip
BlockInput, MousemoveOff ;Enable mouse movement
Loop, Parse, filename, '\
{
IfInString, A_LoopField, %A_Space%
{
dospath := %dospath%"%A_LoopField%"
dospath := dospath\ ;gives error!
}
else
{
dospath := %dospath%%A_LoopField%"\
}
}
Length := StrLen(dospath) -1
dospath := SubStr(dospath, 1 , Length) ; to remove final \