tags:

views:

14

answers:

1

I'd like to be able to alias a dos command to use in conjunction with the runas command

specifically I'm tired of getting the full path to BIDS ("C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"), and I'd like to alias like MS has done for ssms.

Anyone know how to do this? I know I can accomplish this with a batch file, but I'd really rather not.

runas /user:user /netonly bids

vs.

runas /user:user /netonly "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"
A: 

I think the problem you're hitting is that the command line is evaluated as the new user - so unless the new user also has access to your alias, it won't work.

Edit: It's possible you could work around this by creating a conveniently placed batch file (or shortcut?) which launches BIDS and RunAs'ing that?

Basiclife