Hi,
I am running the function below to run a batch file from a specific directory using my VB project. This code has worked fine on Windows 98, 2000, NT etc but when run on Windows XP it seems to have a problem. Instead of looking in the correct directory for the .bat file (which is stored in the variable 'docname' - it automatically looks for the file on the root directory (which seems to be the default in the parameters). Has anyone eles experienced anything like this with XP or have any solution for me.
Thanks in advance,
John B
Public Function StartDoc(DocName As String, Parameter As String) As Long
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
Dim AllocDocName As String
AllocDocName = Space$(200)
AllocDocName = DocName
StartDoc = ShellExecute(Scr_hDC, "Open", AllocDocName, Parameter, "C:\", SW_SHOWNORMAL)
End Function
I am running the function below to run a batch file from a specific directory using my VB project. This code has worked fine on Windows 98, 2000, NT etc but when run on Windows XP it seems to have a problem. Instead of looking in the correct directory for the .bat file (which is stored in the variable 'docname' - it automatically looks for the file on the root directory (which seems to be the default in the parameters). Has anyone eles experienced anything like this with XP or have any solution for me.
Thanks in advance,
John B
Public Function StartDoc(DocName As String, Parameter As String) As Long
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
Dim AllocDocName As String
AllocDocName = Space$(200)
AllocDocName = DocName
StartDoc = ShellExecute(Scr_hDC, "Open", AllocDocName, Parameter, "C:\", SW_SHOWNORMAL)
End Function