Solved

Register DLL via VScript As admin

Posted on 2012-12-21
4
552 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 24

Accepted Solution

by:
lionelmm 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 24

Assisted Solution

by:lionelmm
lionelmm 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
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 lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now