Windows 2003 how do you do runas on a reg file?

  • Thread starter Thread starter jameshanley39@yahoo.co.uk
  • Start date Start date
J

jameshanley39@yahoo.co.uk

how do you do runas on a reg file?
or runas on regedit.exe on a reg file.

by that I mean. Suppose i'm in a non-admin account. If I want to run
an exe, I can right click and do runas, and enter the username and
password of an or the administrative account. But I can't do that
with a reg file.

I can't right click a reg file..

and this doesn't work either
C:\WINDOWS>runas /user:Administrator regedit.exe c:\a.reg

this works in the sense that it opens up regedit and tries to run the
reg file. But can't write to place required 'cos not administrator
C:\WINDOWS>regedit.exe c:\a.reg

this opens regedit, but I want to run a reg file, i don't want to
enter the info from the reg file manually
C:\WINDOWS>runas /user:Administrator regedit.exe
 
<jameshanley39@yahoo.co.uk> wrote in message
news:1184114732.330052.114300@n2g2000hse.googlegroups.com...
> how do you do runas on a reg file?
> or runas on regedit.exe on a reg file.
>
> by that I mean. Suppose i'm in a non-admin account. If I want to run
> an exe, I can right click and do runas, and enter the username and
> password of an or the administrative account. But I can't do that
> with a reg file.
>
> I can't right click a reg file..
>
> and this doesn't work either
> C:\WINDOWS>runas /user:Administrator regedit.exe c:\a.reg
>
> this works in the sense that it opens up regedit and tries to run the
> reg file. But can't write to place required 'cos not administrator
> C:\WINDOWS>regedit.exe c:\a.reg
>
> this opens regedit, but I want to run a reg file, i don't want to
> enter the info from the reg file manually
> C:\WINDOWS>runas /user:Administrator regedit.exe
>


You could try some of the "runas" replacements:
http://www.joeware.net/win/free/tools/cpau.htm
http://groups.google.com/groups?selm=3E272913.27CBE26D@hydro.com
http://www.hiddensoft.com/autoit3/
www.robotronic.de/runasspcEn.html (takes the password from an encrypted
file)
 
Hello,
<jameshanley39@yahoo.co.uk> wrote in message
news:1184114732.330052.114300@n2g2000hse.googlegroups.com...
> how do you do runas on a reg file?
> or runas on regedit.exe on a reg file.
>
> by that I mean. Suppose i'm in a non-admin account. If I want to run
> an exe, I can right click and do runas, and enter the username and
> password of an or the administrative account. But I can't do that
> with a reg file.
>
> I can't right click a reg file..
>
> and this doesn't work either
> C:\WINDOWS>runas /user:Administrator regedit.exe c:\a.reg
>

does work for me:
runas /user:administrator "regedit /s c:\test.reg"
asks for password and enters the regfile without further comment.
Tested on Windows XP Pro SP2 platform.
Maybe the missing quotation marks are your problem.
Best greetings from Germany
Olaf
 
regedit has a menu option for import... that reads a reg file. Would this
be different from "entering info from the reg file manually" for you?

<jameshanley39@yahoo.co.uk> wrote in message
news:1184114732.330052.114300@n2g2000hse.googlegroups.com...
> how do you do runas on a reg file?
> or runas on regedit.exe on a reg file.
>
> by that I mean. Suppose i'm in a non-admin account. If I want to run
> an exe, I can right click and do runas, and enter the username and
> password of an or the administrative account. But I can't do that
> with a reg file.
>
> I can't right click a reg file..
>
> and this doesn't work either
> C:\WINDOWS>runas /user:Administrator regedit.exe c:\a.reg
>
> this works in the sense that it opens up regedit and tries to run the
> reg file. But can't write to place required 'cos not administrator
> C:\WINDOWS>regedit.exe c:\a.reg
>
> this opens regedit, but I want to run a reg file, i don't want to
> enter the info from the reg file manually
> C:\WINDOWS>runas /user:Administrator regedit.exe
>
 
On Jul 11, 11:21 am, "Olaf Engelke [MVP Windows Server]"
<oenew...@mvps.org> wrote:
> Hello,<jameshanle...@yahoo.co.uk> wrote in message
>
> news:1184114732.330052.114300@n2g2000hse.googlegroups.com...> how do you do runas on a reg file?
> > or runas on regedit.exe on a reg file.

>
> > by that I mean. Suppose i'm in a non-admin account. If I want to run
> > an exe, I can right click and do runas, and enter the username and
> > password of an or the administrative account. But I can't do that
> > with a reg file.

>
> > I can't right click a reg file..

>
> > and this doesn't work either
> > C:\WINDOWS>runas /user:Administrator regedit.exe c:\a.reg

>
> does work for me:
> runas /user:administrator "regedit /s c:\test.reg"
> asks for password and enters the regfile without further comment.
> Tested on Windows XP Pro SP2 platform.
> Maybe the missing quotation marks are your problem.
> Best greetings from Germany
> Olaf


thanks for the /s tip, but at the moment i want any error messages or
confirmations, to be displayed. I don't want them to be suppressed!

you were right.. It needed quotes. But then what if the directory has
spaces?

This runs regedit, but it doesn't read the directory properly, and
passes it a succession of wrong paths each bringing up an error box,
and then it gives up.
C:\WINDOWS>runas /user:Administrator "regedit.exe c:\Documents and
Settings\James\desktop\a.reg"
Enter the password for Administrator:
Attempting to start regedit.exe c:\Documents and Settings\James\desktop
\a.reg
as user "BLAH234\Administrator" ...


note: using tab in cmd.exe for filename completion sped that up a bit!
 
Hello,
<jameshanley39@yahoo.co.uk> schrieb im Newsbeitrag
news:1184165297.626415.311420@m3g2000hsh.googlegroups.com...
> On Jul 11, 11:21 am, "Olaf Engelke [MVP Windows Server]"
>> does work for me:
>> runas /user:administrator "regedit /s c:\test.reg"
>> asks for password and enters the regfile without further comment.
>> Tested on Windows XP Pro SP2 platform.
>> Maybe the missing quotation marks are your problem.

>
> thanks for the /s tip, but at the moment i want any error messages or
> confirmations, to be displayed. I don't want them to be suppressed!
>
> you were right.. It needed quotes. But then what if the directory has
> spaces?
>
> This runs regedit, but it doesn't read the directory properly, and
> passes it a succession of wrong paths each bringing up an error box,
> and then it gives up.
> C:\WINDOWS>runas /user:Administrator "regedit.exe c:\Documents and
> Settings\James\desktop\a.reg"

well, try
runas /user:Administrator "regedit.exe \"c:\Documents and
Settings\James\desktop\a.reg\""

Best greetings from Germany
Olaf
 
Back
Top