How to Determine Current CD Winbatch is Running On
Keywords: Determine Current CD Winbatch is Running On
Question:
I am trying to run an application from a cdrom. The issue is that some users may have more than one installed and it may or may not be set to a certain drive letter. How would I detect what drive I am running the application from and how would I set it as the root directory?
Answer:
Assuming you are running a compiled EXE I use:
mypath=DirHome()
mydrive=Strsub(mypath,1,2)
or for a more general version that works with uncompiled wbt's
moi=IntControl(1004,0,0,0,0)
mypath=FilePath()
mydrive=Strsub(mypath,1,2)