******************************************************************************************* *** Program: vistatiplauncher.prg *** Author: Don W. Freeman, PE *** Pass: *** Return: *** Date: *** Copyright: All rights reserved *** Synopsis: ******************************************************************************************** *** Original code from Doug Hennig *** See blog at http://doughennig.blogspot.com/2007/04/elevating-tasks-in-vista.html * lcSystem = oUtility.GetSystemDirectory() * try * oUtility.ShellExecute(lcSystem + 'odbcad32.exe', 'RunAs') * catch * endtry * lparameters tcFileName, ; * tcOperation, ; * tcWorkDir, ; * tcParameters *set step on tcFileName = "tiplauncher.exe" tcOperation = "Open" tcWorkDir = "C:\Program Files\DFDS\TIP\" tcParameters = "RunAs" local lcFileName, ; lcWorkDir, ; lcOperation, ; lcParameters, ; lnShow if empty(tcFileName) return -1 endif &&empty(tcFileName) lcFileName = alltrim(tcFileName) lcWorkDir = iif(vartype(tcWorkDir) = 'C', alltrim(tcWorkDir), '') lcOperation = iif(vartype(tcOperation) = 'C' and not empty(tcOperation),alltrim(tcOperation), 'Open') lcParameters = iif(vartype(tcParameters) = 'C', alltrim(tcParameters), '') lnShow = iif(upper(lcOperation) = 'Print', 0, 1) declare integer ShellExecute in SHELL32.dll ; integer nWinHandle, ; && handle of parent window string cOperation, ; && operation to perform string cFileName, ; && filename string cParameters, ; && parameters for the executable string cDirectory, ; && default directory integer nShowWindow && window state return ShellExecute(0, lcOperation, lcFileName, lcParameters, lcWorkDir, lnShow)and here's the file it's running.
******************************************************************************************* *** Program: TipLauncher.startup.prg *** Author: Don W. Freeman, PE *** Pass: Nothing *** Return: *** Date: *** Copyright: All rights reserved *** Synopsis: Program to update the installed Tip Manager if a newer version is available ******************************************************************************************** parameters lcParameter clear olddate = fdate('c:\program files\dfds\tip\tip.exe',1) newdate = fdate('\\tpdfiles\data\dfreeman\applications\tip_application\tip.exe',1) if newdate > olddate ans = messagebox("There is a newer version of TIP Manager available. " + ; "Would you like to copy it to your workstation now?",3) do case case ans = 6 copy file '\\tpdfiles\data\dfreeman\applications\tip_application\tip.exe' to ; 'c:\program files\dfds\tip\tip.exe' case ans = 2 cancel endcase endif run /N "c:\program files\dfds\tip\tip.exe">Hi Don.
>>return ShellExecute(0, lcOperation, lcFileName, lcParameters, lcWorkDir, lnShow) >>>>produces an error that says "No parameter statement is found." Is there something needed in the EXE being called to receive a parameter? I added lparam at the beginning of it but that only produced another error.