QC20N
asked on
How do I put in parameter in a shellexecute?
uses ShellApi;
var
vAction: String;
vFileName:String;
vParams: String;
vPath: String;
vAction := 'open';
vFileName := 'c:\application.exe';
vParams := 'param1 param2';
vPath := ExtractFilePath(vFileName) ;
ShellExecute(0, PChar(vAction), PChar(vFilename), PChar(vParams), PChar(cPath), SW_SHOWNORMAL);
if Params are:
/v /p
then
vParams := '/v /p';
var
vAction: String;
vFileName:String;
vParams: String;
vPath: String;
vAction := 'open';
vFileName := 'c:\application.exe';
vParams := 'param1 param2';
vPath := ExtractFilePath(vFileName)
ShellExecute(0, PChar(vAction), PChar(vFilename), PChar(vParams), PChar(cPath), SW_SHOWNORMAL);
if Params are:
/v /p
then
vParams := '/v /p';
lol too late
ASKER
You see guys. I have tried that, but with no result. It dosen't start.
If I don't have any params it starts.
If I don't have any params it starts.
action := 'open';
filename := includeTrailingbackslash(getenvironmentvariable('programfiles'))+ 'DameWare Development\DameWare Mini Remote Control\dwrcc.exe';
params := '-c: -a:1'; // -m:' + listbox1.Items.Strings[listbox1.itemindex];
ShellExecute(0, 'open', PChar(fileName + ' ' + Params), nil, nil, SW_SHOWNORMAL);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try:
action := 'open';
filename := includeTrailingbackslash(getenvironmentvariable('programfiles'))+ 'DameWare Development\DameWare Mini Remote Control\dwrcc.exe';
params := '-c: -a:1'; // -m:' + listbox1.Items.Strings[listbox1.itemindex];
ShellExecute(0, 'open', PChar(fileName), PChar(params), nil, SW_SHOWNORMAL);
ok, something strange happened here, I submitted this 25 minutes ago???
ASKER
I can give you 50 point, if you want, for your effort.
Don't worry :)
Be happy
ASKER
I am. :D
Open in new window