Originally posted by Mike Doty
View Post
Announcement
Collapse
No announcement yet.
ShellExecute XP SP3
Collapse
X
-
I do not understand why the bug appears only under XP SP3. Everything is all right under XP SP2.
I then take SHELL (PB). Thanks to all.
Leave a comment:
-
-
Originally posted by Mike Doty View PostIs this a question or did it work using them?
Leave a comment:
-
-
Curious, try changing attribute of program to read-only (since that may be the attribute if run from a CD) and then write protect USB drive.
With WinExec or Shell (PB) is all OK.)Last edited by Mike Doty; 14 Jun 2008, 09:47 AM.
Leave a comment:
-
-
Tried to translate using http://translate.google.com/translate_t?sl=de&tl=en
The disc is write and can not described will.
Remove the protection of the disc USB_128MB in run G:Last edited by Mike Doty; 14 Jun 2008, 09:29 AM.
Leave a comment:
-
-
Another psychic!
Leave a comment:
-
-
ShellExecute - no error code return.
This is a Windows message?!
The message does not appear with CDs. Only at write-protected USB flash drives.
(With WinExec or Shell (PB) is all OK.)Last edited by Bernhard Fomm; 14 Jun 2008, 08:11 AM.
Leave a comment:
-
-
From what I see is that he is running the EXE locally(?) but reading files on the flash drive - drive X:\
I think Mr. Doty is in the right path... "check your function call's success/fail code before blithely calling it a 'bug'"
Leave a comment:
-
-
From what I see is that he is running the EXE locally(?) but reading files on the flash drive - drive X:\
If that's the case, it depends on how the app opens the files. Assuming you are using PB file statements, on a read-only drive/folder/file you must use OPEN <file> FOR <mode> ACCESS READ AS #<num>. The "ACCESS READ" will open the file in read-only mode, otherwise you will get an access denied error.
Leave a comment:
-
-
'What error does this return?
Code:#DIM ALL #INCLUDE "win32api.inc" DECLARE SUB ShellExecuteErrors(ErrorNumber AS LONG) FUNCTION PBMAIN () AS LONG LOCAL result AS LONG result = SHELLEXECUTE(0,"open","prog.exe","","x:\",%SW_SHOWNORMAL) ShellExecuteErrors result SLEEP 2000 END FUNCTION SUB ShellExecuteErrors(ErrorNumber AS LONG) IF ErrorNumber > 32 THEN EXIT SUB 'If the function fails, the return value is an error value that is less than or equal to 32. The following table lists these error values: SELECT CASE ErrorNumber CASE 0 ? "The operating system is out of memory or resources." CASE %ERROR_FILE_NOT_FOUND ?"The specified file was not found." CASE %ERROR_PATH_NOT_FOUND ? "The specified path was not found." CASE %ERROR_BAD_FORMAT ? "The .EXE file is invalid (non-Win32 .EXE or error in .EXE image)." CASE %SE_ERR_ACCESSDENIED ? "The operating system denied access to the specified file." CASE %SE_ERR_ASSOCINCOMPLETE ? "The filename association is incomplete or invalid." CASE %SE_ERR_DDEBUSY ? "The DDE transaction could not be completed because other DDE transactions were being processed." CASE %SE_ERR_DDEFAIL ? "The DDE transaction failed." CASE %SE_ERR_DDETIMEOUT ? "The DDE transaction could not be completed because the request timed out." CASE %SE_ERR_DLLNOTFOUND ? "The specified dynamic-link library was not found." CASE %SE_ERR_FNF ? "The specified file was not found." CASE %SE_ERR_NOASSOC ? "There is no application associated with the given filename extension." CASE %SE_ERR_OOM ? "There was not enough memory to complete the operation." CASE %SE_ERR_PNF ? "The specified path was not found." CASE %SE_ERR_SHARE ? "A sharing violation occurred. CASE ELSE ? "ShellExecute value was" + STR$(ErrorNumber) END SELECT END SUB #IF 0 SW_HIDE Hides the WINDOW AND activates another window. SW_MAXIMIZE Maximizes the specified window. SW_MINIMIZE Minimizes the specified WINDOW AND activates the NEXT top-level WINDOW IN the Z order. SW_RESTORE Activates AND displays the window. IF the WINDOW IS minimized OR maximized, Windows restores it TO its original SIZE AND position. An application should specify this flag when restoring a minimized window. SW_SHOW Activates the WINDOW AND displays it IN its current SIZE AND position. SW_SHOWDEFAULT Sets the show state based ON the SW_ flag specified IN the STARTUPINFO structure passed TO the CreateProcess FUNCTION by the program that started the application. An application should CALL ShowWindow WITH this flag TO SET the initial show state OF its MAIN window. SW_SHOWMAXIMIZED Activates the WINDOW AND displays it AS a maximized window. SW_SHOWMINIMIZED Activates the WINDOW AND displays it AS a minimized window. SW_SHOWMINNOACTIVE Displays the WINDOW AS a minimized window. The active WINDOW remains active. SW_SHOWNA Displays the WINDOW IN its current state. The active WINDOW remains active. SW_SHOWNOACTIVATE Displays a WINDOW IN its most recent SIZE AND position. The active WINDOW remains active. SW_SHOWNORMAL Activates AND displays a window. IF the WINDOW IS minimized OR maximized, Windows restores it TO its original SIZE AND position. An application should specify this flag when displaying the WINDOW FOR the first time. IF lpFile specifies a document file, nShowCmd should be zero. #ENDIF
Last edited by Mike Doty; 14 Jun 2008, 01:09 AM.
Leave a comment:
-
-
>(Bug comes only under XP SP3.)
Um, then maybe the 'bug' is in XP/SP3 and not the Microsoft ShellExecute function?
If you need a workaround, you can try....- ShellExecuteEx
- CreateProcess
- PB "SHELL"
If all those fail, try open the EXE file for read-only, copy it somewhere and execute from there. Or maybe just Try Filecopy or copyfile (one is PB one is WinAPI).
Need a folder with guaranteed "write permission?" Use GetTempPath() winapi function.
Leave a comment:
-
What bug?
From code shown all I can see is an error raised because it is write protected so you cant open it...
I have not tried it...but from 1st glance I bet thats the case
Leave a comment:
-
-
ShellExecute XP SP3
I have an old usb-flash-drive with write protect switch.
ShellExecute brings a bug if I would like to start a EXE file and the usb flash drive is write protected.Is the bug known? (Bug comes only under XP SP3.)
Code:ShellExecute 0, "open", "prog.exe", "", "x:\", 1
Tags: None
-
Leave a comment: