Use the
RegisterOcx.bat to register the new OCX File on your Computer
Use the
UnRegisterOcx.baf to deinstall the OCX File
Dim ObjAdr
Set ObjAdr
= WScript.CreateObject("WSHWIControl.WSHExt")
Set ObjAdr
= Nothing
Syntax: Object.WSHGetINI("SectionName","KeyName","
TheINIFile")
Example: Answer = objadr.WSHGetINI("Test","Name5","c:\temp\test.ini")
After execute the WSHGetINI the value is stored in the variable Answer, this
one has to be defined with the Dim command (Dim Answer)
Syntax: Object.WSHWriteINI "SectionName",KeyName","Value","
TheINIFile"
Examle: objadr.WSHWriteINI
"Test","Name5","Mr. Thomas
Miller","c:\temp\test.ini"
If the key still exist it will overwrite, new keys are created automatically
Syntax: Object.WSHGetSections("TheINIFile")
Example: Answer =
objAdr.WSHGetSections("c:\temp\test.ini")
After execute the WSHGetSections the section names are comma separated in the
variable Answer, this one has to be defined with the Dim command (Dim Answer)
Syntax: Object.WSHGetKeys("SectionName","TheINIFile")
Example: Answer =
objAdr.WSHGetKeys("Test","c:\temp\test.ini")
After execute the WSHGetKeys the key names are comma separated in the variable Answer,
this one has to be defined with the Dim command (Dim Answer)
Syntax: Object.WSHINIDelKey "SectionName","KeyName","TheINIFile"
Example: objadr.WSHINIDelKey
"Test","Name2","c:\temp\test.ini"
Syntax: Object.WSHINIDelSection "SectionName","TheINIFile"
Example: objadr.WSHINIDelSection
"Test2","c:\temp\test.ini"
Syntax: Object.WSHSleep TIMEinMiliseconds
Example: objAdr.WSHSleep 1000
Sleep the Script for one second
option Explicit
Dim ObjAdr
Dim Antwort
'
Declaration of the ActiveX Control
set ObjAdr =
WScript.CreateObject("WSHWIControl.WSHExt")
' Read a
key from the INI file
Antwort =
objadr.WSHGetINI("Test","Name5","c:\temp\test.ini")
WScript.Echo "I have read this key form
the INI file:" + chr(13) + Antwort
' Write to
the INI file
objadr.WSHWriteINI
"Test","Name5","Mr. Thomas
Miller","c:\temp\test.ini"
WSCript.Echo "I have write 'Mr. Thomas
Miller' to the INI File"
' Show all sections
of the INI file
Antwort =
objAdr.WSHGetSections("c:\temp\test.ini")
WScript.Echo "Those sections are in the
INI file:" + chr(13) + Antwort
' Take a
sleep about 1 second
objAdr.WSHSleep 1000
' Show all
keys of a section
Antwort = objAdr.WSHGetKeys("Test","c:\temp\test.ini")
WScript.Echo "This are the keys of the
section Test:" + chr(13) + Antwort
' Clear a
key in a section of a INI file
objadr.WSHINIDelKey
"Test","Name2","c:\temp\test.ini"
' Clear a
section in a INI file
objadr.WSHINIDelSection
"Test2","c:\temp\test.ini"
' Clear the
memory of the Object and exit
set ObjAdr = Nothing
WScript.Quit()