SimpleUpdater

Discuss and share scripts and script files...
serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: SimpleUpdater

Post by serendipity »

Marco wrote:
serendipity wrote:
Marco wrote:@serendipity

Can you write VBS code also for closing every XY and XYcopy window after a delay?
Close or kill??
Close. There should be a way to focus a window and then send an Alt+F4, but never investigated further...
Yeah should be possible if it is possible to get the window title.

drewkeller
Posts: 33
Joined: 01 Nov 2008 05:29

Re: SimpleUpdater

Post by drewkeller »

Check out the console command (graceful if you leave off the /F switch)

Code: Select all

taskkill /IM xyplorer.exe
taskkill /IM xycopy.exe
Or for vbscript something like (I don't think vbs has any native way to do it gracefully)

Code: Select all

sub killProcess(strProcessName)
    set colProcesses = GetObject("winmgmts:\\.\root\cimv2").ExecQuery("Select * from Win32_Process Where Name='" & strProcessName & "'")
    if colProcesses.count <> 0 then
        for each objProcess in colProcesses
            objProcess.Terminate()
        next
    end if
end sub 

killProcess "xyplorer.exe"
killProcess "xycopy.exe"
Or I imagine you could use an AutoIt script exported out to an exe

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: SimpleUpdater

Post by serendipity »

drewkeller wrote:Check out the console command (graceful if you leave off the /F switch)

Code: Select all

taskkill /IM xyplorer.exe
taskkill /IM xycopy.exe
Or for vbscript something like (I don't think vbs has any native way to do it gracefully)

Code: Select all

sub killProcess(strProcessName)
    set colProcesses = GetObject("winmgmts:\\.\root\cimv2").ExecQuery("Select * from Win32_Process Where Name='" & strProcessName & "'")
    if colProcesses.count <> 0 then
        for each objProcess in colProcesses
            objProcess.Terminate()
        next
    end if
end sub 

killProcess "xyplorer.exe"
killProcess "xycopy.exe"
Or I imagine you could use an AutoIt script exported out to an exe
Yeah, was going to suggest task kill but it's not supported in xp home and 2000 i think.

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: SimpleUpdater

Post by Marco »

serendipity wrote:Yeah, was going to suggest task kill but it's not supported in xp home and 2000 i think.
I confirm, taskkill is available only as part of a Resource Kit for older Windows. That's the same problem I faced when writing my updating script: XP doesn't offer all the batch commands available in 7.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

drewkeller
Posts: 33
Joined: 01 Nov 2008 05:29

Re: SimpleUpdater

Post by drewkeller »

Perhaps the new Exit command can have the option "a" (all) to close all XYplorer and XYcopy windows... ? Seems like that would be the cleanest and most reliable solution. Then you could (if you need to do it externally for some reason)

Code: Select all

' Close all XY windows (with save) and block until it completes
cmd.exe /k "xyplorer.exe /win=min /flg=2 /script="::Exit 'sa'" "
If you're doing it from inside XY, obviously all you need is the script command.

admin
Site Admin
Posts: 64833
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SimpleUpdater

Post by admin »

Each XYplorer has its own garbage (XYcopy) collection. One cannot just kill XYcopy instances from outside because they might be doing important things.

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: SimpleUpdater

Post by serendipity »

admin wrote:Each XYplorer has its own garbage (XYcopy) collection. One cannot just kill XYcopy instances from outside because they might be doing important things.
Good point, i'll include this maybe:

Code: Select all

   
    IF (get ("XYcopy_Pending")!=0){ 
    end 1==1, "Cannot update, XYcopy running."; 
    }
Also, can get("instance") enumerate how many open instances?
Last edited by serendipity on 13 Sep 2012 17:53, edited 1 time in total.

admin
Site Admin
Posts: 64833
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SimpleUpdater

Post by admin »

serendipity wrote:Also, can get("instance") enumerate how many open instances?
No, this is unknown.

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: SimpleUpdater

Post by serendipity »

admin wrote:
serendipity wrote:Also, can get("instance") enumerate how many open instances?
No, this is unknown.
OK, thanks.

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: SimpleUpdater

Post by klownboy »

serendipity, very slick and even nicer now without the need of a support file. It deserved it's own place on my toolbar.
Thanks,
Ken
Attachments
SimpleUpdater.JPG
SimpleUpdater.JPG (40.17 KiB) Viewed 4129 times

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: SimpleUpdater

Post by serendipity »

klownboy wrote:serendipity, very slick and even nicer now without the need of a support file. It deserved it's own place on my toolbar.
Thanks,
Ken
Thanks. Nice buttons there!

Filehero
Posts: 2713
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: SimpleUpdater

Post by Filehero »

I assigned it the XY-logo as a button since it's calling home. :wink:


Cheers,
Filehero

Filehero
Posts: 2713
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: SimpleUpdater

Post by Filehero »

Hi,

I'm still excited, this updater is an awesome script. The functional impact per LoC is tremendous!
:appl:


Cheers,
Filehero

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: SimpleUpdater

Post by klownboy »

Hey Filehero, it's been awhile. Yes, I just changed my icon over to the XYplorer logo as well. For anyone interested you can grab it by typing in http://www.xyplorer.com/favicon.ico into your address bar and then right click on the logo to save it to your drive.
Thanks,
Ken

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: SimpleUpdater

Post by serendipity »

Filehero wrote:Hi,

I'm still excited, this updater is an awesome script. The functional impact per LoC is tremendous!
:appl:


Cheers,
Filehero
Thanks!

Post Reply