Restored from previous forum. Originally posted by PB.
I too am using Windows 2000 Pro and GetCommandLine_() returns PATH+NAME+ARGUMENTS for me. I also just tested this on Win95 and Win98 with the same results. Not sure how you're getting just NAME+ARGUMENTS ??
Okay, here's the deal: Make a new exe (called test.exe) from this code:
r=GetCommandLine_() : app$=peeks(r) : r=FindString(app$," ",1)
If r>0 : cmd$=mid(app$,r+1,255) : app$=left(app$,r-1) : EndIf
MessageRequester("Test","AppName: "+app$+chr(13)+"Cmdline: "+cmd$,0)
End
Next, put this exe in C:\Program Files\PureBasic\test.exe
Now, open a DOS box in C:\ (without CD'ing to another folder) and enter: "C:\Program Files\PureBasic\test.exe" wow. You'll get an AppName of
C:\Program and Cmdline of
Files\PureBasic\test.exe" wow.
Now, in the DOS box, CD to the actual exe (so that when you type dir you see the exe itself. Then, enter: test wow. This time, you'll get an AppName of
test and Cmdline of
wow.
So, it would appear that the result returned depends highly on
where you launch the exe from, ie. the same or a remote folder.
Edited by - PB on 20 September 2001 04:25:04