07
Jun
11

How to use nested quotes on the Runas command

This isn’t exactly SharePoint related, but it does deal with SQL Server (that is used by SharePoint) so I’m going to post it here anyways.  So shoot me.

To run SQL Server Enterprise Manager (Ouch!  What is he doing with SQL 2000?) as another user from the command line you can either use short file names or nested quotes.

C:\Windows\System32\runas.exe /user:domain\username "C:\Windows\System32\mmc.exe /s C:\Progra~2\Mi3EDC~1\80\Tools\BINN\SQLSer~1.msc"

If you want to use short filenames, you can cd to each directory and perform a dir /x to display the short directory or filename.

image

Or, if you want to use long filenames:

C:\Windows\System32\runas.exe /user:domain\username "C:\Windows\System32\mmc.exe /s \"C:\Program Files (x86)\Microsoft SQL Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC"\"

The trick to using long filenames is to use \" for the first nested quote and "\ for the matching nested quote.

In either case, when you run the shortcut you’ll be prompted to enter your password.

image

Advertisement

0 Responses to “How to use nested quotes on the Runas command”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


Asif Rehmani’s SharePoint Videos

SharePoint-Videos

Click to access a wealth of SharePoint videos

SharePoint Rx

SharePoint Rx Home

Categories

Posts by Date

June 2011
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
Support Wikipedia

%d bloggers like this: