Hi Yasser,
I prefer to use ShellExecute() over Run() because it offers several actions, accepts content files, launches files within the associated program ID, and thereby is not only limited to fire off executable files like Run().
Give it a try and maybe you solve the issue on Win2008R2 64bit.
Run this code from a PB Window:
// external function declaration
FUNCTION long ShellExecute (uint ihwnd,string lpszOp, string lpszFile,string lpszParams, string lpszDir,int wShowCmd ) LIBRARY "Shell32.dll" ALIAS FOR "ShellExecuteA;ANSI"
// specify operation against external file, pass parameters if needed, set basedir etc...
ll_rc = ShellExecute( handle(This), "open", "upload.bat", ls_parm, as_basedir, 0)
Best,
.m
P.S.
Microsoft docs at: https://docs.microsoft.com/en-us/windows/desktop/api/shellapi/nf-shellapi-shellexecutea
I would recommend what Marco suggests however, I would recommend implementing this as a Unicode command ...
Function long ShellExecute ( &
long hwindow, &
string lpOperation, &
string lpFile, &
string lpParameters, &
string lpDirectory, &
long nShowCmd &
) Library "shell32.dll" Alias for "ShellExecuteW"
Regards ... Chris
This ShellExecute function does work for the 32 bit application but not work for the 64 bit application . Do I have to do something different for 64 bit ?
For 64 but support, please try ...
Function LongPTR ShellExecute ( &
LongPTR hwindow, &
string lpOperation, &
string lpFile, &
string lpParameters, &
string lpDirectory, &
long nShowCmd &
) Library "shell32.dll" Alias for "ShellExecuteW"
HTH
Regards ... Chris