?
Solved

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

Posted on 2006-07-05
3
Medium Priority
?
985 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 1500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

840 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