Jump to content

Question related to strings


HenK
 Share

Recommended Posts

Hi,

Who can help me with the following:

This is my script for processing quickpar files:

While 1

$teller = $teller + 1

$file = FileFindNextFile($search)

If @error Then ExitLoop

Run ("c:\Program Files\Quickpar\Quickpar.exe")

winwaitactive ("QuickPar - Select Files To Protect")

send ("!O") ; open a file

WinWaitActive ("Select recovery volume")

MsgBox (0, "Processing file" & $teller, $file)

send ("!n") ; go to the control where you enter the file name

send ($file)

send ("!o") ; start processing

winwaitactive ("QuickPar")

send ("!E")

This works fine for all filenames, except for "vol0+1.PAR2".

This filename prints OK with the MsgBox instruction, but transforms to "vol0!.PAR2" when sent with the send instruction.

Can anyone please tell me how to fix this?

HenK

Link to comment
Share on other sites

This works fine for all filenames, except for "vol0+1.PAR2".

This filename prints OK with the MsgBox instruction, but transforms to "vol0!.PAR2" when sent with the send instruction.

Can anyone please tell me how to fix this?

HenK

+ has a special meaning for send. It sends the SHIFT keys, that's why you see ! (SHIFT 1). You must escape the + (and all other "special characters" - see help file for send())

$string = "+1"
$newstring = StringReplace($string,"+","{+}")
Send($newstring)

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...