Page 1 of 1

Problems with Scripting Run command

Posted: 27 Jan 2015 21:34
by hermhart
I don't know what it is, but I seem to have the hardest time with the Run command for scripting. I have the 'setting' command in there to disable background processing, but yet it seems like I still need to use the 'wait' command as when I use 'run', the 'wait' portion of the 'run' command is not honored.

I really want the the line with 'run' in it to be something along the lines of: run """$current\purge.bat.lnk""", , 2; but the '2' never seems to be honored, and when I do try to use it, I get "%1 is not a valid Win32 application". Other iterations that I try seem to tell me something about Overflow 0/0. Does anyone have any help for this?

Code: Select all

setting "BackgroundFileOps", 0; //disable background processing
 set $current, <curpath>;
 copyto , "U:\Startup_Folders\purge.bat.lnk";
 wait 2000; //pauses for 2 seconds
 run """$current\purge.bat.lnk""";
 delete 1, 0, "$current\purge.bat.lnk";
 wait 5000; //pauses for 5 seconds
 Focus('List');
 sel a;
 rename e, "1";
Thank you for any help that anyone can provide.

Re: Problems with Scripting Run command

Posted: 27 Jan 2015 23:31
by PeterH
How do you add the , , 2 :?:
run """$current\purge.bat.lnk""", , 2;

Don't put it inside the quotes.
(Maybe misunderstood? And: not tested...)

Re: Problems with Scripting Run command

Posted: 27 Jan 2015 23:59
by PeterH
Now with a bit of testing:
run "cmd /c ""$current\purge.bat.lnk""", , 2;

should really help. :whistle:

By the way: what syntax is this:
set $current, <curpath>;

(Yes, I know: it's not wrong 8) )

Re: Problems with Scripting Run command

Posted: 28 Jan 2015 14:37
by hermhart
PeterH,

That seemed to do the trick. Never even crossed my mind to put the cmd /c option in there. Thank you so much!

Since you asked about the set $current, <curpath>; my intent was to make sure that I kept that path in case I changed directories during the file operations. But now, I may not have to do that.

Thank you again!

Re: Problems with Scripting Run command

Posted: 28 Jan 2015 18:10
by bdeshi
hermhart wrote:Since you asked about the set $current, <curpath>;
heh, I'm sure his implication was that we usually write it as: $current = <curpath>;
( or to please Peter: $current = "<curpath>"; :mrgreen: )

This is easier to a skimming eye.

Re: Problems with Scripting Run command

Posted: 28 Jan 2015 22:33
by PeterH
SammaySarkar wrote:
hermhart wrote:Since you asked about the set $current, <curpath>;
heh, I'm sure his implication was that we usually write it as: $current = <curpath>;
:lol: :lol: :lol: Yesss!
SammaySarkar wrote: ( or to please Peter: $current = "<curpath>"; :mrgreen: )

This is easier to a skimming eye.
:lol: :lol: :lol: Nonono :naughty:
I'd say <curpath> is a variable, and so needs no quotes. :ugeek:
Though quotes are allowed here, no question :mrgreen:

Re: Problems with Scripting Run command

Posted: 29 Jan 2015 07:53
by bdeshi
D'oh!