Solved

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

Posted on 2006-07-05
3
966 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

705 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

17 Experts available now in Live!

Get 1:1 Help Now