title image


Smiley Re: Geht nat”rlich
Mal so als Ansatz...



f”r das Behandeln der Datei: FileSystemObject (Teil des Microsoft Scripting Runtime Moduls - scrrun.dll)



Dim objFSO As New FileSytemObject

Dim objFolder As Folder, objSub As Folder

Dim objFile As File

Dim objStream



Dim strCTRL As String



Const For_Reading = 1

Const For_Writing = 2



Set objStream = objFSO.OpenTextFile("Path\Control.ini",For_Reading)



strCTRL = objStream.ReadAll



objStream.Close



Select Case strCTRL



Case strPr”fstring



"Hole die DeviceID und schreibe sie in das ini"



Set objStream = objFSO.OpenTextFile("Path\Control.ini",For_Writing)

objStream.WriteLine strDeviceID



Case strDeviceID



"Starte Deine Scripte"



Case Else



"Lsche die Files"



Set objFolder = objFSO.GetFolder("Pfad")



For Each objSub in objFolder.SubFolders



objSub.Delete



Next objSub



For Each objFile in objFolder.Files



objFile.Delete



Next objFile















End Select



F”r die DeviceID - WMI







Dim strComputer As String

Dim objWMIService

Dim propValue

Dim objItem

Dim SWBemlocator

Dim UserName As String

Dim Password As String

Dim colItems

Dim bolCTRL As Boolean



strComputer = "."

UserName = ""

Password = ""



Set SWBemlocator = CreateObject("SWbemLocator")

Set objWMIService = SWBemlocator.ConnectServer(strComputer,"root\CIMV2",UserName,Password)

Set colItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive",,48)

For Each objItem in colItems



strDeviceID = objItem.DeviceID



Edit: hate das italic vergessen zu schlie©¬en... (-;



Next






mfg Mike

Snafu



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: