Problems with Scripting Run command

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
hermhart
Posts: 244
Joined: 13 Jan 2015 18:41

Problems with Scripting Run command

Post 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.
Windows 11 Pro; 100% scaling

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Problems with Scripting Run command

Post 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...)

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Problems with Scripting Run command

Post 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) )

hermhart
Posts: 244
Joined: 13 Jan 2015 18:41

Re: Problems with Scripting Run command

Post 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!
Windows 11 Pro; 100% scaling

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Problems with Scripting Run command

Post 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.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Problems with Scripting Run command

Post 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:

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Problems with Scripting Run command

Post by bdeshi »

D'oh!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply