Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use unc path as value using regwrite????

Status
Not open for further replies.

AntunB

IS-IT--Management
Aug 11, 2003
263
AU
Hey i want to have a value that contains a unc path, is it possible through regwrite?

so i want "\\server\path" as a value

so if i do this:

WshShell.RegWrite "HKCU\Software\testing\\\server\path", 0, "REG_DWORD"

the key srever is made with valu of path. it treats it incorrectly

is there a way to do this?
or do i have 2 use wmi?

thanks
 
AntuneB,

I have only this to offer.
Code:
const HKEY_CURRENT_USER=&H80000001

sSubkey="Software\testing"
sVname="\\server\path"
dwValue=0

set svc=GetObject("winmgmts:root\default:StdRegProv")
iRet=svc.setdwordvalue(HKEY_CURRENT_USER,sSubkey,sVname,dwValue)
set svc=nothing

if iRet=0 then wscript.echo "done" else wscript.echo "failed"
Regwrite approach? No.

regards - tsuji
 
thanks i thought as much

but was hoping to do it with WshShell.RegWrite


thanks
 
i would be so bold as to say it cant be done, i think tsuji's approach is all you can do in vbscript.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top