Solved

Simple vbscript to modify registry key permission.

Posted on 2004-04-22
5
2,192 Views
Last Modified: 2007-12-19
Hi, I don't know vbscript but I have found a few code examples that do a nice job of doing 90% of a task I am trying to accomplish. I am stuck trying to find a very simple example of code to modify (grant everyone full-control) to a single registry key. Can anyone provide or reference me to a concise example of code to do this one specific task? I am not looking for a robust program just something very simple.

Thanks,
Scott
0
Comment
Question by:gscotte
[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
  • 4
5 Comments
 
LVL 1

Expert Comment

by:calebS
ID: 10896841
I don't have any code examples, but was trying to do the same thing in VB, and it was yucky.

There is no simple '10 lines of code' way, it requires a couple of pages of code, I will have a look for a link, but just be warned...
0
 
LVL 1

Expert Comment

by:calebS
ID: 10896860
Hey, I might be wrong about this, the following link has a *.zip file download.

http://www.winnetmag.com/Article/ArticleID/37940/37940.html

NB. I found this on the second page of a google search, remember google is your friend...
0
 
LVL 1

Accepted Solution

by:
calebS earned 250 total points
ID: 10896864
Listing 1: Script to Write a Change to the Registry
Option Explicit
‘Define the variables to use.
Dim oWshShell
Set oWshShell = CreateObject("Wscript.Shell")
oWshShell.RegWrite ("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal
Server\Compatibility\Applications\AppName\Flags", 18)


Listing 3: Script to Confirm a Registry Setting
Option Explicit
Dim oWshShell, sValue
Set oWshShell = CreateObject("Wscript.Shell")
sValue = oWshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Terminal
Server\WinStations\RDP-TCP\PortNumber")
oWshShell.LogEvent 4, "Terminal Services is currently listening on port "& sValue & "."

0
 
LVL 1

Expert Comment

by:calebS
ID: 10896868
If this is so easy in VBScript why is it such a nightmare in VB??????
0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
MS Access - Capture pressed key onclick 4 43
Hide vba in gp 7 114
vb6, excel Run-time error 1004 method 'close' of object 'workbooks' failed 7 67
Spell Check in VB6 13 137
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

761 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