pikaeh Posted September 27, 2009 Share Posted September 27, 2009 ;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"' or $r = '"HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"' & ', ' & '"NoDrives"' & ', ' & '"REG_DWORD"' & ', ' & '"3"' MsgBox(0, "$r", $r) RegWrite($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? Link to comment Share on other sites More sharing options...
dantay9 Posted September 27, 2009 Share Posted September 27, 2009 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]) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now