Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Can DOS Batch file Tell Running Program to Exit

    I am running an old program in WinXP in VirtualBox and would like to be able to initiate a normal exit of that old program from a batch file but I don't think there is any way to do that.

    Any ideas will be appreciated!

    Thanks,
    Bill

  2. #2
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,420
    Thanks
    33
    Thanked 195 Times in 175 Posts
    You haven't said where the BATch file is running, but I presume also in VirtualBox.

    I know of no way to perform a normal exit, but you could kill the task.
    Not having XP any more I can't go much further, but have a look at either KILL /? or TASKKILL.EXE /?, whichever applies to XP.

    Later...

    Some research and further thought says that TASKKILL is available in XP Pro but not XP Home (no idea why), and there is also the SysInternals command PsKill

    Note that I have no knowledge of the provenance of the download link for TASKKILL from the GreasyPC Blogspot link...
    Last edited by BATcher; 2015-09-10 at 13:08. Reason: More thought!
    BATcher

    Time prevents everything happening all at once...

  3. #3
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post
    Thanks Batcher for the suggestions. Yes, the batch file is running in VirtualBox.

    The reason for looking into this is that there is one data file in the virtual machine that needs to be copied into the normal file structure so it can be backed up normally. I need to read more about VirtualBox; maybe it has a provision for backing up a file in this kind of situation.

    Thanks,
    Bill

  4. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 985 Times in 915 Posts
    XP allows you to backup a file that is in use, as do later versions of Windows. Load a free backup program and backup the file locally (on the VM) then copy it to the required location.

    cheers, Paul

  5. #5
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post
    Thanks for the suggestion Paul. I'm not clear about whether or not it is possible to back up the virtual drive that contains the file, after the VirtualBox is closed. After all, that file is not any use to me except in the virtual environment because the program will only run in that environment. So, if I can just backup that virtual drive I'll have my backup covered. I would appreciate anything you know about this.

    Thanks,
    Bill

  6. #6
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 985 Times in 915 Posts
    The virtual disk contains all the operating system files as well as your program and data, so backing up the VD regularly may be overkill. My suggested backup method.
    Backup the VM files once. These can be restored to another machine if recovery is required.
    Backup the data files created by the application in the VM and copy them to to the physical machine. Do this regularly.
    Backup data on the physical machine regularly.

    cheers, Paul

  7. #7
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post
    Thanks Paul. I didn't think of those system files being in the same place. I'll go back and look at the situation again and go from there.

    Thanks,
    Bill

  8. #8
    Silver Lounger RolandJS's Avatar
    Join Date
    Dec 2009
    Location
    Austin metro area TX USA
    Posts
    1,730
    Thanks
    95
    Thanked 128 Times in 125 Posts
    [I get NO credit for the following real cool and working batchfile.]
    From someone somewhere in internet land, I got the following batchfile:
    rem BATchfiling Windows Update
    sc config wuauserv start=auto
    net start wuauserv
    C:\WINDOWS\System32\wuapp.exe startmenu
    pause
    net stop wuauserv
    sc config wuauserv start=disabled
    pause
    exit

    The person who wrote this and the other ON & OFF batchfile was and still is a genius!
    I hope to give proper credit to that person!

    Meanwhile, maybe the above batchfile can be modified to work for you.
    "Take care of thy backups and thy restores shall take care of thee." Ben Franklin revisited.
    http://collegecafe.fr.yuku.com/forum...-Technologies/

  9. #9
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,420
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Roland - I'd be happier about the BATch file you quote if the author had given some information about why the WUAUSERV service was originally stopped on the author's machine.

    And even happier if the BATch file automatically caused the running of outstanding important updates, without merely bringing up the Windows Update menu!

    Hence the need for included explanations/comments in all BATch files...
    BATcher

    Time prevents everything happening all at once...

  10. #10
    3 Star Lounger
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    221
    Thanks
    80
    Thanked 3 Times in 2 Posts
    BATcher
    Roland - I'd be happier about the BATch file you quote if the author had given some information about why the WUAUSERV service was originally stopped on the author's machine.

    And even happier if the BATch file automatically caused the running of outstanding important updates, without merely bringing up the Windows Update menu!

    Hence the need for included explanations/comments in all BATch files...

    This might be why, ( there are many issues with xp update, I just picked the one that had SOLVED).
    Came from another source.
    I am not sure if allowed or not to post the link, but I have saved it if anyone wants to know more.
    It says;
    Question

    How to fix windows update error

    Solved Answer

    Actually, Most of the windows update issues occurs due to the last windows update couldn’t updated properly or maybe get corrupted file. Once it get corrupted, you’ll get the error message while updating the windows and your windows can’t be update. That’s why it has stopped when you try to update your windows again. and give you a error message. might be have some more problem with windows systems files. Anyway, we have the proper solution to fix windows update errors. Here you learn how to re-register all the “dll” files that related to windows update and also learn how to get start working all the services related with Windows update, Please follow the steps mentioned below.
    I used a an alterantive search engine and get surprising results.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •