Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

Running a batch file

microsoft.public.windows.vista.security






Speedup My PC
Reply
  #1 (permalink)  
Old 09-25-2009
Timbo
 

Posts: n/a
Running a batch file
Please, please can some one help me...

I am trying to run a batch file in vista as an administrator. I know I can
use the RUNAS command, but this prompts me for a password. (and what
password is a mystery to me as it's a non domain machine and there isn't a
user called administrator, but that's besides the point). What I am
looking to do is to replicate the behaviour of Right Clicking on the batch
file and clicking 'Run as administrator', then the security box comes up -
this is fine, that is EXACTLY what I want to happen. The user already has
adminitrator privilages and I understand that I'll never get around the
security box coming up - I don't mind this, but I can't seem to find a way
of replicating this.

Any ideas will be greatfully received.

Thanks

Tim


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-25-2009
Peter Foldes
 

Posts: n/a
Re: Running a batch file
Timbo

You are using OE to post here. Is that the machine in question or is it a Vista Home
which cannot accomplish what you are asking

--
Peter

Please Reply to Newsgroup for the benefit of others
Requests for assistance by email can not and will not be acknowledged.

"Timbo" <me@home.com> wrote in message news:OUTluRfPKHA.1232@TK2MSFTNGP05.phx.gbl...
> Please, please can some one help me...
>
> I am trying to run a batch file in vista as an administrator. I know I can use
> the RUNAS command, but this prompts me for a password. (and what password is a
> mystery to me as it's a non domain machine and there isn't a user called
> administrator, but that's besides the point). What I am looking to do is to
> replicate the behaviour of Right Clicking on the batch file and clicking 'Run as
> administrator', then the security box comes up - this is fine, that is EXACTLY
> what I want to happen. The user already has adminitrator privilages and I
> understand that I'll never get around the security box coming up - I don't mind
> this, but I can't seem to find a way of replicating this.
>
> Any ideas will be greatfully received.
>
> Thanks
>
> Tim
>


Reply With Quote
  #3 (permalink)  
Old 09-25-2009
Bruce Chambers
 

Posts: n/a
Re: Running a batch file
Timbo wrote:
> Please, please can some one help me...
>
> I am trying to run a batch file in vista as an administrator. I know I can
> use the RUNAS command, but this prompts me for a password. (and what
> password is a mystery to me ....



It's the username/password for whatever account with local
administrative privileges that you wish to use to run the batch file.


>.... as it's a non domain machine....



Not relevant.


> and there isn't a
> user called administrator,


Of course, there is. However, by default in Vista, the Built-in
Administrator account is disabled.


> .... but that's besides the point). What I am
> looking to do is to replicate the behaviour of Right Clicking on the batch
> file and clicking 'Run as administrator', then the security box comes up -
> this is fine, that is EXACTLY what I want to happen. The user already has
> adminitrator privilages and I understand that I'll never get around the
> security box coming up - I don't mind this, but I can't seem to find a way
> of replicating this.
>


I believe (haven't had to do this for a long time, and don't have a
Vista machine handy to test it) that in order to use Runas.exe in the
batch file, you'd have to specify the user account, and then it will
prompt for a password as necessary.

RUNAS USAGE:

RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
/user:<UserName> program

RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]
/smartcard [/user:<UserName>] program

RUNAS /trustlevel:<TrustLevel> program

/noprofile specifies that the user's profile should not be
loaded.
This causes the application to load more quickly, but
can cause some applications to malfunction.
/profile specifies that the user's profile should be loaded.
This is the default.
/env to use current environment instead of user's.
/netonly use if the credentials specified are for remote
access only.
/savecred to use credentials previously saved by the user.
This option is not available on Windows 7 Home or
Windows 7
Starter Editions
and will be ignored.
/smartcard use if the credentials are to be supplied from a
smartcard.
/user <UserName> should be in form USER@DOMAIN or
DOMAIN\USER
/showtrustlevels displays the trust levels that can be used as
arguments
to /trustlevel.
/trustlevel <Level> should be one of levels enumerated
in /showtrustlevels.
program command line for EXE. See below for examples

Examples:
> runas /noprofile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""


NOTE: Enter user's password only when prompted.
NOTE: /profile is not compatible with /netonly.
NOTE: /savecred is not compatible with /smartcard.


--

Bruce Chambers

Help us help you:
http://www.catb.org/~esr/faqs/smart-questions.html

http://support.microsoft.com/default.aspx/kb/555375

They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. ~Benjamin Franklin

Many people would rather die than think; in fact, most do. ~Bertrand Russell

The philosopher has never killed any priests, whereas the priest has
killed a great many philosophers.
~ Denis Diderot
Reply With Quote
  #4 (permalink)  
Old 09-25-2009
Dave-UK
 

Posts: n/a
Re: Running a batch file

"Timbo" <me@home.com> wrote in message news:OUTluRfPKHA.1232@TK2MSFTNGP05.phx.gbl...
> Please, please can some one help me...
>
> I am trying to run a batch file in vista as an administrator. I know I can
> use the RUNAS command, but this prompts me for a password. (and what
> password is a mystery to me as it's a non domain machine and there isn't a
> user called administrator, but that's besides the point). What I am
> looking to do is to replicate the behaviour of Right Clicking on the batch
> file and clicking 'Run as administrator', then the security box comes up -
> this is fine, that is EXACTLY what I want to happen. The user already has
> adminitrator privilages and I understand that I'll never get around the
> security box coming up - I don't mind this, but I can't seem to find a way
> of replicating this.
>
> Any ideas will be greatfully received.
>
> Thanks
>
> Tim
>
>


Try creating a shortcut to the batch file.
Right-click the shortcut and select Properties.
On the Shortcut tab select Advanced.
Tick 'Run as Administrator' , Ok and Apply.
Run the shortcut.



Reply With Quote
  #5 (permalink)  
Old 09-25-2009
Bob
 

Posts: n/a
Re: Running a batch file
http://www.msfn.org/board/lofiversio...hp/t97318.html


"Timbo" <me@home.com> wrote in message
news:OUTluRfPKHA.1232@TK2MSFTNGP05.phx.gbl...
> Please, please can some one help me...
>
> I am trying to run a batch file in vista as an administrator. I know I
> can use the RUNAS command, but this prompts me for a password. (and what
> password is a mystery to me as it's a non domain machine and there isn't a
> user called administrator, but that's besides the point). What I am
> looking to do is to replicate the behaviour of Right Clicking on the batch
> file and clicking 'Run as administrator', then the security box comes up -
> this is fine, that is EXACTLY what I want to happen. The user already has
> adminitrator privilages and I understand that I'll never get around the
> security box coming up - I don't mind this, but I can't seem to find a way
> of replicating this.
>
> Any ideas will be greatfully received.
>
> Thanks
>
> Tim
>


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a batch file Timbo microsoft.public.windows.vista.general 4 09-25-2009 22:10
Running a batch file with scheduler simonc microsoft.public.windows.vista.general 5 01-29-2009 03:03
Will computer sleep while batch file is running? hannaxbear microsoft.public.windows.vista.general 4 08-17-2008 13:52
Task Scheduler Returned Error 0x2 While Running Batch File lqd1967 microsoft.public.windows.vista.administration accounts passwords 0 06-09-2008 12:00
running batch files... maya microsoft.public.windows.vista.general 12 08-23-2007 02:26




All times are GMT +1. The time now is 02:01.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120