Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Register DLL via VScript As admin

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

721 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