call an exe as administrator from inside a pgm

call an exe as administrator from inside a pgm

Postby jorjio » Mon Feb 17, 2014 10:38 pm

Hi,
We use Fivewin 7.01 for Harbour with xhb which I think it is 2009 01. Anyhow, I am opening an executable from inside my program with shellexecute which returns no error but the executable has no results . On two or three computers the application works but not on my computer which has vista. Winexec does not work either although it does not return error. If I run my application as Administrator the call to the executable has effect. So, I need a function or a parameter that opens the executable as administrator from inside the program. Thank you in advance.
jorjio
 
Posts: 14
Joined: Tue Sep 10, 2013 8:08 pm

Re: call an exe as administrator from inside a pgm

Postby anserkk » Wed Feb 19, 2014 4:46 am

oShell:= CreateObject("Shell.Application")
oShell:ShellExecute ("E:\demo\batchScript.cmd", "", "", "runas", 1)
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: call an exe as administrator from inside a pgm

Postby Baxajaun » Wed Nov 21, 2018 6:35 am

Dear anserkk,

this code

Code: Select all  Expand view  RUN

   oShell := CreateObject("Shell.Application")
   oShell:ShellExecute ("C:\Windows\System32\msg.exe","BAXAJAUN 'Hola Mundo !!!'", "", "runas", 1)
 


isn't ok for us

Image

Thanks in advance !

Best regards
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Re: call an exe as administrator from inside a pgm

Postby Baxajaun » Wed Nov 21, 2018 10:09 am

Hi !

Fixed it ! Is a permission problema, if copy msg.exe to application directory, shellexecute() function run msg.exe

Thanks in advance !

Best regards,
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 65 guests