cmd line - RunAs - nothing happens

Isaac

Lifelong Learner
Local time
Today, 14:23
Joined
Mar 14, 2017
Messages
11,395
Ok you command line geniuses .... what am I doing wrong?

Bat file contents:

Code:
runas /profile /user:MyUsername "\"C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE\" /r \"U:\Test\Test.xlsx\""

When I double click the bat file to run it, it does successfully open up the command window, and asks me to enter credentials for MyUsername
I enter them (I know what they are, because it's my own username - I'm just testing this out) and hit Enter.

That's it. The command window disappears, nothing else happens. I am positive the path for excel.exe is right (I can Paste it into a Run window and hit Enter and Excel opens), and I'm positive the path for u:\test\test.xlsx is right.

What am I missing here, I know next to nothing about command line stuff.

I'm using advice from here:
excel - Runas a certain xls file - Stack Overflow
under the "Hence, your line should be as follows" example
 
Darn it, I think I answered my own question with a Pause line. It told me the password was wrong, but really it wanted domain\user rather than just user
once I did that, it works - only now it says it can't find u:\test\test.xlsx, which seems wrong...but that will be some other problem I guess?
 
Enjoying this conversation with yourself are ya??!?
 
I did get it working with the code that I originally posted with one exception, instead of referencing the u-drive I reference the full Network path. So your comment may be correct if I had been continued to use the drive. Not sure honestly
 
I did get it working with the code that I originally posted with one exception, instead of referencing the u-drive I reference the full Network path. So your comment may be correct if I had been continued to use the drive. Not sure honestly
Did you see the examples in that link?
 
I did not look at it because what I was using ended up working after all. It turned out my problem wasn't syntax it was specifying a User without the Domain.
 
he does it all the time. =)
Hands down the best conversations I have...
Really helps you get close to yourself...
Move over Andrew Cuomo's daughter, I feel a brand new never-before-discovered identity coming on!
 

Users who are viewing this thread

Back
Top Bottom