Questions

Exe in Batch File

Tags:
+
0 Votes
Locked

Exe in Batch File

eddieduce
I have a batch file that will perform several task and then run a small executable to open the DVD drive after it is done processing. It works fine wile I'm logged on BUT when I'm logged off the executable will not run to open the DVD drive!

I am suspecting that it is not identiying the DVD drive. I am running a Windows 2003 standard server.
  • +
    0 Votes
    sgt_shultz

    i wonder if you batch file is running at all when you are logged off. i think you need to make your script a 'process' to run that way.
    Easy way out might be to make it a scheduled task that runs every so often?

    +
    0 Votes
    garymac12

    Try running it as a scheduled task as you can specify your logon credentials with a scheduled task as well. At least this way you will see if it is a permissions issue or not. You might want to put something else in the batch file to help you see if it is actually running or not.

    +
    0 Votes
    eddieduce

    The script is designed to back up and eject the DVD drive disk while logged off. The backup part works fine but it seems that when the backup process is completed, either the executable is not run or there is some sort of error during the process because it just sits still AFTER the backup parts of the script conclude.

    I could test making it a process and running task scheduler; I will leave this as a last resort after trying other eject exe's or VBS' as tests.

    +
    0 Votes
    huoml

    I downloaded eject.exe (I do not remember from where).
    I created a batch file that contained only one command to eject the cd/dvd.
    I scheduled it to run as local administrator and logged off and when the command ran, it ejected the cd tray.
    I scheduled the same batch file to run as local user (no special priviledges) and the task would not run.
    I added the user to local administrators group and the task ran with success.

    hth
    -H

    +
    0 Votes
    eddieduce

    huoml,

    What OS are did you test this under? I am using the eject executable for the command prompt form this website:

    http://www.kanasolution.com/download.php

    +
    0 Votes
    huoml

    Soory about that. I should have said that in my post.

    I have installed W2K3 standard in a VM. Standalone servr (no domain).

    I got the program from

    http://sedivy.com/utils/#eject


    hth
    -H

    +
    0 Votes
    eddieduce

    huoml, Is there a feature that could be locking the drive and preventing it from ejecting? Even if I manually go to the drive and press the Open/close button on the drive, it does not open when logged off.

    I think that it could also be I am using Easy CD creator to make the disk readable before ejecting, or it cicks in automatically anyways, and it probably is not running while I am logged off?

    +
    0 Votes
    ugadata

    In order for your batch file to work a user of some sort will need to logged in.

    Rather than logging out of the PC, try locking the computer and see if that allows the batch file to run correctly.

    +
    0 Votes
    eddieduce

    Thanks for your reply ugdata,

    I have already setup the login and password part. My script backs up network drive folders and backs them up to my DVD drive. Everything is controlled by one script. The backup part works fine. Only that the exe is not executing.

    I had the PC logged in and locked for this and other programs but I am actually turning away from this and am either running as service or scheduling which is my prefference for this script because there are also scheduled restarts for which runing under a locked account is not convenient.

  • +
    0 Votes
    sgt_shultz

    i wonder if you batch file is running at all when you are logged off. i think you need to make your script a 'process' to run that way.
    Easy way out might be to make it a scheduled task that runs every so often?

    +
    0 Votes
    garymac12

    Try running it as a scheduled task as you can specify your logon credentials with a scheduled task as well. At least this way you will see if it is a permissions issue or not. You might want to put something else in the batch file to help you see if it is actually running or not.

    +
    0 Votes
    eddieduce

    The script is designed to back up and eject the DVD drive disk while logged off. The backup part works fine but it seems that when the backup process is completed, either the executable is not run or there is some sort of error during the process because it just sits still AFTER the backup parts of the script conclude.

    I could test making it a process and running task scheduler; I will leave this as a last resort after trying other eject exe's or VBS' as tests.

    +
    0 Votes
    huoml

    I downloaded eject.exe (I do not remember from where).
    I created a batch file that contained only one command to eject the cd/dvd.
    I scheduled it to run as local administrator and logged off and when the command ran, it ejected the cd tray.
    I scheduled the same batch file to run as local user (no special priviledges) and the task would not run.
    I added the user to local administrators group and the task ran with success.

    hth
    -H

    +
    0 Votes
    eddieduce

    huoml,

    What OS are did you test this under? I am using the eject executable for the command prompt form this website:

    http://www.kanasolution.com/download.php

    +
    0 Votes
    huoml

    Soory about that. I should have said that in my post.

    I have installed W2K3 standard in a VM. Standalone servr (no domain).

    I got the program from

    http://sedivy.com/utils/#eject


    hth
    -H

    +
    0 Votes
    eddieduce

    huoml, Is there a feature that could be locking the drive and preventing it from ejecting? Even if I manually go to the drive and press the Open/close button on the drive, it does not open when logged off.

    I think that it could also be I am using Easy CD creator to make the disk readable before ejecting, or it cicks in automatically anyways, and it probably is not running while I am logged off?

    +
    0 Votes
    ugadata

    In order for your batch file to work a user of some sort will need to logged in.

    Rather than logging out of the PC, try locking the computer and see if that allows the batch file to run correctly.

    +
    0 Votes
    eddieduce

    Thanks for your reply ugdata,

    I have already setup the login and password part. My script backs up network drive folders and backs them up to my DVD drive. Everything is controlled by one script. The backup part works fine. Only that the exe is not executing.

    I had the PC logged in and locked for this and other programs but I am actually turning away from this and am either running as service or scheduling which is my prefference for this script because there are also scheduled restarts for which runing under a locked account is not convenient.