I have a .bat file that maps a network drive, runs an MS Access program then deletes the mapped drive and exits. When I run it through Control-M the .bat runs and finishes but the job in Control-M never ends. I have tried multiple things to end the file to send Control-M an exit code but nothing seems to be working. Below is the code:
@echo off
net use w: [path]
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "Y:\MSAccess.mdb"
net use w: /delete
After this code I have tried the following commands:
exit
_exit 0
timeout /T 10
No matter what I try Control-M never seems to know that the job has finished. The sysout from Control-M also does not show any kind of exit code being sent back.