Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DOS program works differently within VFP
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01242242
Message ID:
01242302
Views:
33
>You knwo what, I think you are right. I will try the following since the program doesnt' take commas between parameters.
>
>
>lcParam1=oApp.cImageFolder + "\" + Photos.cFileName
>lcParam2=lcPath2PICSFolder
>lcParam3=lcImageName
>lcCommand=[RUN C:\Dev\GetData\ProcImages.EXE] + lcParam1 + [ ] + lcParam2 + [ ] + lcParam3
>&lcCommand
>
Why do you need to use RUN command at all?
Would this work ?
PROCEDURE RunShellScript
LPARAMETERS tcCommand, tlSilentMode, tcRetVal

IF EMPTY(m.tcCommand)
	RETURN
ENDIF

LOCAL oShell, llError, loException, lnErrorCode
llError = .F.
TRY
	oShell = CREATEOBJECT("WScript.Shell")
CATCH TO loException
	IF m.tlSilentMode
		tcRetVal = "Run-time error: WScript.Shell Object is not Found"
	ELSE
		=MESSAGEBOX("Run-time error: WScript.Shell Object is not Found")
	ENDIF
	llError = .T.
ENDTRY
IF m.llError <> .T.
	TRY
		lnErrorCode = oShell.RUN(m.tcCommand, 0,.T.) && SW_SHOW_HIDDEN 0,SW_SHOW_NORMAL 1,SW_SHOW_MINIMIZED 2,SW_SHOW_MAXIMIZED 3
		IF m.lnErrorCode <> 0
			tcRetVal = "Error in running shell command. Error Code: " + TRANSFORM(m.lnErrorCode)
		ENDIF
	CATCH TO loException
		IF m.tlSilentMode
			tcRetVal = "Run-time error: WScript.Shell: " + ;
				m.tcCommand + CHR(13) + CHR(10) + Log_Error(m.loException)
		ELSE
			=MESSAGEBOX("Run-time error: WScript.Shell: " + m.tcCommand)
		ENDIF
		llError = .T.
	ENDTRY
ENDIF
RELEASE oShell

RETURN !m.llError
and in your case the command will be
lcCommand = [C:\Dev\GetData\ProcImages.EXE] + lcParam1 + [ ] + lcParam2 + [ ] + lcParam3
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform