Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > File I/O and Registry > wmi to edit registry


Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2012, 03:53 PM
k_babb k_babb is offline
Newcomer
 
Join Date: Aug 2010
Posts: 3
Default wmi to edit registry


Can someone help me to figure out how i can add credentials to my script i want to be able to add the following registy changes to another pc in my workgroup but want to run as an admin i know the admin username and password on the remote machine but dont know how to run the script as the administrator on the remote machine ps the username and password on my machine are differnt to remote machine and windows firewall is off on both machines

thanks for any help

Code:
HKEY_CURRENT_USER = &H80000002
strComputer = inputbox ("Enter Computer Name")
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "\SYSTEM\CurrentControlSet\Control\Terminal Server"
ValueName = "fDenyTSConnections"
strValue = inputbox ("Enter 00000000 to Enable RDP, 00000001 To Disable RDP")
objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, ValueName, strValue
Reply With Quote
  #2  
Old 04-04-2012, 12:35 PM
vbmani vbmani is offline
Newcomer
 
Join Date: Oct 2011
Posts: 8
Default

You wrote about a workgroup, there's no a domain controller (you could already be admin)?
Do you want to write the admin password in a script (be carefull)?

I googled that your you and I think you need the first result...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->