Here they are, some code snippets that prevent you from only going into the local user or useing dll's
"Get String"
usage:
a$=getreg$("HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Session Manager/Environment","PROCESSOR_IDENTIFIER")
Should get your processor name/model.
(this one isn' Too fast..)
function getreg$(path$,key$)
if file exist("c:reg.reg") then delete file "c:reg.reg"
reg$="/e c:reg.reg "+chr$(34)+path$+chr$(34)
execute file "regedit.exe",reg$,""
repeat : a=a+1 : until file open(a)=0
length=len(chr$(34)+key$+chr$(34))
repeat : c=c+1 : until file exist("c:reg.reg")=1 or c=1000
if c=1000 then exitfunction
set dir "c:"
open to read a,"reg.reg"
repeat
read string a,string$
if mid$(string$,1)=mid$(key$,1)
repeat
read string 1,stringb$
string$=string$+stringb$
d=d+1
until d>length or string$=key$ or mid$(key$,d)<>mid$(string$,d)
d=0
if key$=string$
repeat
read string a,string$
if aa=2 and string$<>chr$(34) then param$=param$+string$
if string$=chr$(34) then aa=aa+1
until aa=4
endif
endif
until file end(a)=1 or left$(string$,length)=chr$(34)+key$+chr$(34) or param$<>""
close file a
if file exist("c:reg.reg") then delete file "c:reg.reg"
endfunction param$
"Fix Slash"
if getting strings from the registry it usally has a double slash, like "C:dirfile.txt"
usage:
goodstring$=fixslash(badstring$)
function fixslash(input$)
for x=0 to len(input$)
if mid$(input$,x)=""
if mid$(input$,x-1)="" then output$=output$+""
else
output$=output$+mid$(input$,x)
endif
next x
endfunction output$
"Put String"
use for importing strings to the registry.
usage:
writereg("HKEY_CLASSES_ROOT/DarkBasicPro.Project/shell/print/command","","%SystemRoot%system32NOTEPAD.EXE /p %1")
note: ""=(default)
function writereg(path$,key$,string$)
if file exist("c:regwrite.reg") then delete file "c:regwrite.reg"
open to write 1,"c:/regwrite.reg"
write string 1,"REGEDIT4"
write string 1,""
write string 1,"["+path$+"]"
write string 1,chr$(34)+key$+chr$(34)+"="+chr$(34)+string$+chr$(34)
close file 1
execute file "regedit.exe","/s c:/regwrite.reg","c:/windows/system32",1
wait 10
if file exist("c:regwrite.reg") then delete file "c:regwrite.reg"
endfunction
(just to let you know, this example would give the .dba files a 'print' on right-click)
note: don't use a double slash on the key name or path, only on the value, or it won't import.
Hope you'll like it
we'll all turn mad someday..