Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Register DLL via VScript As admin

Posted on 2012-12-21
4
Medium Priority
?
620 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 26

Accepted Solution

by:
Lionel MM earned 2000 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 26

Assisted Solution

by:Lionel MM
Lionel MM earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

927 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