0

I'm trying to use runas in a way that launches an exe that has to load a file for example:

runas /user:domain\admin /savecred "C:\program files\program directory\program.exe file.sse"

If I run from command line just the file path and the file extension then it works fine, stick runas in front of it and it errors failing to load the file.

Any ideas if this can be modified to work?

I'm thinking a bat file that maybe calls up the runas to run the program saved as a variable maybe?

Thanks

1
  • 1
    The first idea is that the account that you are running the app as does not have access rights.
    – EBGreen
    Jan 26, 2015 at 15:37

1 Answer 1

1

You simply need to quote the path to the program.exe too, and escape the internal quotes with a backslash (\), like this:

runas /user:domain\admin /savecred "\"C:\program files\program directory\program.exe\" file.sse"

2
  • Thank you Jesper, I thought I tried every formation of this available but obviously not, will remember that one for future reference :)
    – CharlesH
    Jan 26, 2015 at 17:41
  • Glad I could help, Charles!
    – Jesper
    Jan 28, 2015 at 1:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .