I'm needing some help creating a .vbs file that will call a .bat file with certain parameters. What the bat file will do is read a CD and send all 'compatible' files it finds via a DICOM transfer. When it finishes, I would need to eject the CD and then display a message box with some text and an 'OK' button.
Here is what I am currently using which isn't working out too well.
Set objshell = WScript.CreateObject ("WScript.Shell")
objshell.Run "c:\apps\dcm4che-3.3.3-bin\bin\storescu -c RADTRAUMACD@LOCALHOST:104 -s 00080050=OUT 00100021=HOSP -b ERCD@localhost e: > c:\apps\logs\radtraumacd_send_log.txt"
objshell.Run "c:\cdr.exe open E:"
x=msgbox("The import job is finished, please remove your CD/DVD." ,0, "CD Import")
The 'cdr.exe' is something I found to open the CDROM as I had originally been using this in a .bat file. I need to switch over to VBS so that I can get a msg box to display to the user, so the line that calls 'cdr.exe' can disappear if VBS can open the CDROM. The message box is displayed before the 'storescu' has had time to finish running. Also, there is no logic for it to detect if a CD has been inserted. My CDROM drive letter is 'E:'.
When the drawer is closed, it might or might not have a different CD inserted. I was hoping I could have this loop and 'wait' for a CD to be inserted and if so, then run the 'storescu' command.