2

My program C:\Program Files\MyApp\Myprog starts with Windows startup; at device insertion Myprog.exe invokes another program C:\Windows\comp.exe.
This process works fine in the admin account in which I install the programs but Myprog.exe is unable to invoke comp.exe when users account is changed.
I want C:\Windows\comp.exe to be invoke in each type of account e.g admin group accounts and non-admin accounts. Please help P.S both programs are not UAC patched.

1

In your exec-command inside the your application you could use the Windows built-in command runas.

For example:

runas /noprofile /user:mymachine\administrator "C:\Program Files\MyApp\Myprog.exe"

(you can probably omit the domain mymachine\ in your environment)


A different solution would be to make the comparison in a temporary directory with full access to the user, since it seams you try to do this in a protected directory on he system drive. - Maybe in the user's home.

Unfortunately I know nothing about "Myprog". But maybe you forgot to set the working directory of "comp.exe" so it tries to run inside C:\Windows which is of course protected from non-administrators.


runas reference same problem, solution with a batch file

  • How to specify password from command line? Or it is not required? – Michael Freidgeim Sep 3 '18 at 3:47
  • You can use runas' /savecred flag in order to save the credentials of the other user to your account. – Philipp Sep 4 '18 at 5:04

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.