cmd line - RunAs - nothing happens (1 Viewer)

Isaac

Lifelong Learner
Local time
Today, 02:18
Joined
Mar 14, 2017
Messages
8,777
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
 

Isaac

Lifelong Learner
Local time
Today, 02:18
Joined
Mar 14, 2017
Messages
8,777
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?
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 05:18
Joined
Apr 27, 2015
Messages
6,328
Enjoying this conversation with yourself are ya??!?
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:18
Joined
Sep 21, 2011
Messages
14,260

Isaac

Lifelong Learner
Local time
Today, 02:18
Joined
Mar 14, 2017
Messages
8,777
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
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:18
Joined
Sep 21, 2011
Messages
14,260
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?
 

Isaac

Lifelong Learner
Local time
Today, 02:18
Joined
Mar 14, 2017
Messages
8,777
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.
 

Isaac

Lifelong Learner
Local time
Today, 02:18
Joined
Mar 14, 2017
Messages
8,777
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

Top Bottom