Solved

Register DLL via VScript As admin

Posted on 2012-12-21
4
594 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

752 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