Jump to content
Sign in to follow this  


Recommended Posts


;RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\", "NoDrives", "REG_DWORD", "3")

$r = '"HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoDrives", "REG_DWORD", "3"'


$r = '"HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"' & ', ' & '"NoDrives"' & ', ' & '"REG_DWORD"' & ', ' & '"3"'

MsgBox(0, "$r", $r)


I'm trying to read the $r value from an ini file and run it with RegWrite($r) but that doesn't work. What am I doing wrong?

Share this post

Link to post
Share on other sites

You cannot put multiple parameters into a single string. You can use stringsplit if you have to put the parameters together, but it would be best to just use separate variables for each parameter.

$a = "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
$b = "NoDrives"
$c = "REG_DWORD"
$d = "3"

RegWrite($a, $b, $c, $d)

or you could use stringsplit:

$r = "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,NoDrives,REG_DWORD,3"
$Split = StringSplit($r, ",")

RegWrite($Split[1], $Split[2], $Split[3], $Split[4])

[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.