
April 11th, 2008 by

Yaron Assa

Loading ...
Get all running processing on the local machine:
Dim objWMIService, objProcess, colProcess
Dim strComputer, strList
strComputer = “.”
Set objWMIService = GetObject(”winmgmts:” _
& “{impersonationLevel=impersonate}!\\” _
& strComputer & “\root\cimv2″)
Set colProcess = objWMIService.ExecQuery _
(”Select * from Win32_Process”)
For Each objProcess in colProcess
strList = strList & vbCrLf & _
objProcess.Name
Next
Print strList

April 1st, 2008 by

daniva

Loading ...
Use the Win32_TimeZone class and check the value of the Description property.

April 1st, 2008 by

daniva

Loading ...
To convert WMI dates to FILETIME or VT_DATE format or to parse the date into component year, month, day, hours, and so on, you must write your own code.

March 31st, 2008 by

daniva

Loading ...
All we have to do is write a WMI query that includes the path of the folder we want to check as well as the file extension we’re checking for. For example, this script retrieves a collection of all the .bak files found in the C:\Logs folder:

March 31st, 2008 by

daniva

Loading ...
the immediately solution is by using a WMI script. Admittedly, we could have achieved the same results by using the FileSystemObject.
We opted to go with WMI for one simple reason: that enables us to run this script against remote computers.

March 31st, 2008 by

daniva

Loading ...
Sometimes we need to rename all the files in a given folder, either by appending the date, changing the file extension.
The following example simulates a backup operation, by renaming all files extensions in the LOG folder from .log to .bak.
The Script assumes that you already have a folder under location C:\LOG and assumes that the folder contains at least 1 xxxx.log file.
Recent Comments