Exe in Batch File

By 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.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

scheduled task??

by sgt_shultz In reply to Exe in Batch File

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?

Collapse -

I agree...

by garymac12 In reply to scheduled task??

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.

Collapse -

Good Running Script?

by eddieduce In reply to scheduled task??

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.

Collapse -

EXE in batch file

by huoml In reply to Exe in Batch File

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.


Collapse -

Working Eject.exe

by eddieduce In reply to EXE in batch file


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

Collapse -


by huoml In reply to Working Eject.exe

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


Collapse -

DVD Eject Script

by eddieduce In reply to EJECT CD

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?

Collapse -

User must be logged on

by ugadata In reply to Exe in Batch File

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.

Collapse -

Auto Login

by eddieduce In reply to User must be logged on

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.

Related Discussions

Related Forums