Page 4 of 9

Re: SimpleUpdater

Posted: 12 Sep 2012 22:11
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.

Re: SimpleUpdater

Posted: 13 Sep 2012 06:52
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

Re: SimpleUpdater

Posted: 13 Sep 2012 07:43
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.

Re: SimpleUpdater

Posted: 13 Sep 2012 08:10
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.

Re: SimpleUpdater

Posted: 13 Sep 2012 15:45
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.

Re: SimpleUpdater

Posted: 13 Sep 2012 15:54
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.

Re: SimpleUpdater

Posted: 13 Sep 2012 17:40
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?

Re: SimpleUpdater

Posted: 13 Sep 2012 17:44
by admin
serendipity wrote:Also, can get("instance") enumerate how many open instances?
No, this is unknown.

Re: SimpleUpdater

Posted: 13 Sep 2012 17:46
by serendipity
admin wrote:
serendipity wrote:Also, can get("instance") enumerate how many open instances?
No, this is unknown.
OK, thanks.

Re: SimpleUpdater

Posted: 14 Sep 2012 00:55
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

Re: SimpleUpdater

Posted: 14 Sep 2012 02:58
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!

Re: SimpleUpdater

Posted: 14 Sep 2012 07:07
by Filehero
I assigned it the XY-logo as a button since it's calling home. :wink:


Cheers,
Filehero

Re: SimpleUpdater

Posted: 14 Sep 2012 11:38
by Filehero
Hi,

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


Cheers,
Filehero

Re: SimpleUpdater

Posted: 14 Sep 2012 19:18
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

Re: SimpleUpdater

Posted: 15 Sep 2012 19:16
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!