holemania
asked on
VScript or Bat Script to Register DLL File as Administrator
I need help registering a dll file as administrator. I can right click the cmd and then "Run as Administrator". This would allow me to register, however, my issue is that I need to register this for over 100+ PC.
So I need help to do this as a login script. Normally this is how I would register the dll file.
This is for 64-bit OS:
C:\Windows\SysWOW64\Regsvr 32.exe "\\serverA1\ERP\sscvix.dll "
This is for 32-bit OS:
C:\Windows\System32\Regsvr 32.exe "\\serverA1\ERP\sscvix.dll "
So need help with determining which OS is on that PC as well as registering that dll file as administrator. Any ideas?
So I need help to do this as a login script. Normally this is how I would register the dll file.
This is for 64-bit OS:
C:\Windows\SysWOW64\Regsvr
This is for 32-bit OS:
C:\Windows\System32\Regsvr
So need help with determining which OS is on that PC as well as registering that dll file as administrator. Any ideas?
Have you looked at the RUNAS command in Vista and WIndows 7? It's probably more suited to what you're looking for. The only problem is if you used a batch file for this, you'll need to put an admin level password plain text inside it. This will require you to give your users execute NTFS permissions and remove read NTFS permission.
Untitled.png
Untitled.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you.
http://social.technet.microsoft.com/Forums/eu/ITCG/thread/310e57f9-2367-4293-9f97-53d0e077aacc
Here is a script that forces UAC elevation:
'-------------------------
'Elevate this script before invoking it.
'25.2.2011 FNL
'-------------------------
bElevate = False
if WScript.Arguments.Count > 0 Then If WScript.Arguments(WScript.
if bElevate Or WScript.Arguments.Count = 0 Then ElevateUAC
'******************
'Your script goes here
'******************
'-------------------------
'Run this script under elevated privileges
'-------------------------
Sub ElevateUAC
sParms = " |"
If WScript.Arguments.Count > 0 Then
For i = WScript.Arguments.Count-1 To 0 Step -1
sParms = " " & WScript.Arguments(i) & sParms
Next
End If
Set oShell = CreateObject("Shell.Applic
oShell.ShellExecute "wscript.exe", WScript.ScriptFullName & sParms, , "runas", 1
WScript.Quit
End Sub