Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 6th, 2003, 06:59 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Run registry keys in VBScript

Hi!
I what to run these two keys, but i simply dont know how to write the code.

*********
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\Shell Folders]
"Favorites"="\\\\lf08sn01\\%username%$\\EgnaData\\ Favorites"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\User Shell Folders
"Favorites"="\\\\lf08sn01\\%username%$\\EgnaData\\ Favorites"

****************

Reply With Quote
  #2 (permalink)  
Old August 6th, 2003, 05:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you are running the script locally on the computer check out http://www.greggriffiths.org/webdev/wsh/examples.html
Reply With Quote
  #3 (permalink)  
Old August 8th, 2003, 06:44 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!
It did not really help me, though. My fault, I really stink when it comes to scripting...

I tried to run this through a script, but it didnt work:

Option Explicit
on error resume next
Dim Net, oNetwork, wshShell, EnvVar, sUserName, IPConfigSet, ObjIfUser, IPConfig, iLoop, ObjGroup, ObjUser
Dim sHomeServer, sProgServer, sInstServer
set oNetwork = CreateObject("Wscript.Network")
Set net = CreateObject("WScript.Network")
Set wshShell = CreateObject("Wscript.Shell")
Set EnvVar = wshShell.Environment("Process")
sUserName=EnvVar.Item("username")

If IsMember("LFAD",susername,"G-08-users")=True Then
 wshshell.run("cmd /c H:\FavoritesOnServer.reg")
End If


Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch. 10 - Creating Registry Keys InfinityLtd BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 2 July 9th, 2008 12:32 PM
How do you scan for bad registry keys? raimir Pro VB.NET 2002/2003 4 June 11th, 2007 04:38 AM
Update records with multiple keys (ASP VBScript) rbrynest SQL Server ASP 4 April 27th, 2005 05:28 AM
Registry Keys reyboy General .NET 2 March 21st, 2005 08:25 PM
help on scanning for bad registry keys raimir Pro VB 6 2 January 7th, 2005 09:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.