Solved

A VB Script to delete & then merge a registry file / key

Posted on 2006-07-05
3
967 Views
Last Modified: 2012-08-13
Hi All,

I'm having problems with my Terminal Server Licensing Service, so as a fix i neen to create a vbscript to delete the following key HKEY_LOCAL_MACHINE\\Software\\Microsoft\\MSLicensing and import file \\birmingham\dfsroot\Private\Upgrades\TimeKeeper_TS\tslic.reg

Many Thanks
0
Comment
Question by:BarkersIT
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
justchat_1 earned 500 total points
ID: 17047027
         Dim appShell
          Set appShell = CreateObject("WScript.Shell")
          Call appShell.Run("cmd.exe /k reg delete hklm\Software\Microsoft\MSLicensing /f", 1, True)
          Call appShell.Run("cmd.exe /k reg import \\birmingham\dfsroot\Private\Upgrades\TimeKeeper_TS\tslic.reg", 1, True)
          Set appShell = Nothing
0
 
LVL 1

Author Comment

by:BarkersIT
ID: 17049392
Thanks for you help, In the final solution I used some of your code, but amended it slightly as I did not want the command prompt popping up on screen, as we now have a pretty vbscript logon process.

I'll be awarding you the points as you are the only person that helped, and will post the code I used below

'---------------------------------------
' Install TS Reg Key - due to ts license server failure
'---------------------------------------
Dim wshShell
Set wshShell = CreateObject("WScript.Shell")
wshShell.Run "reg delete hklm\Software\Microsoft\MSLicensing /f", 0, True
wshShell.Run "reg import \\birmingham\dfsroot\Private\Upgrades\TimeKeeper_TS\tslic.reg", 0, True
Set wshShell = Nothing
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 17053034
Glad to help...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

911 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

24 Experts available now in Live!

Get 1:1 Help Now