Solved

Register DLL via VScript As admin

Posted on 2012-12-21
4
581 Views
Last Modified: 2013-01-01
I need to register some dll files on user's PC when they reboot with the login bat script.  I was thinking of creating a vscript that would register the dll files.  However, in order to register the dlls, I need to run as admin with cmd.

Can this be done with Vscript by doing some kind of impersonation?  If so, please help with examples.
0
Comment
Question by:holemania
  • 2
4 Comments
 
LVL 7

Expert Comment

by:jkdt0077
ID: 38713338
Hi

I think you could do this using Group Policy. You could store the BAT file somewhere in network then modify following group policy rule:

GPO\Computer Configuration\Policies\Windows Settings\Scripts (Startup/Shutdown)
0
 
LVL 25

Accepted Solution

by:
Lionel MM earned 500 total points
ID: 38715526
This can be done. What operating systems are you wanting to do this on? Depending on your OS this may work
Try this runas.exe /? Example:
runas.exe /savecred /user:administrator "defrag c:"
It saves the password 1 st time and never asks again. may be when you change the admin password you will be prompted again or do you want the password included?
0
 
LVL 25

Assisted Solution

by:Lionel MM
Lionel MM earned 500 total points
ID: 38715539
You can also try this--old DOS trick--works but not very secure; not sure it will work in VB
echo password | runas.exe /savecred /user:username "cmd"

/user:UserAccountName : Specifies the name of the user account under which to run the program. The user account format should be user@domain or Domain\User.
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/runas.mspx?mfr=true
0
 

Author Closing Comment

by:holemania
ID: 38734818
Thanks that was helpful.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question