Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Suggested Solutions

Title # Comments Views Activity
Run code from text file in vb 1 101
Microsoft Access combo box help 2 57
MsgBox 4 75
Remove Exif Orientation before adding image to db 9 62
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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

739 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