Posts

Showing posts with the label Cheat Code

List Windows XP Running Process And ProcessID in VBScript

Image
One of my reason why I hate Windows XP is because it is prone to virus. However, I can't escape from using it because there are instruments which I use that can only communicate with it's own proprietary windows program. Love it or not, I still need these proprietary programs to run in the windows box on site because they don't have linux version of it nor even going to have it. Leaving the windows box like that. I believe in some way, it will get infected when some user access the box to grab some data with their infected USB drive or there is virus in the network. It simply happened last two weeks on the site box where this virus prevent me to open the Windows Task Manager to show what process is running in the box. Thanks to VBScript which allows me to view the running process and investigate. So, after getting frustated and cursing the virus prone OS for some time, I just open Notepad program and begin writing this script: '==========================================...

My Cheat Code to Create Properties in VB6

Image
Did you ever feel lazy to type the same code with a small modification but it is every where. And doing the same work repeatedly for let say 34 times? I will feel like my hand got the RSI (Repetitive Strain Injury). The most common task that I encounter this situation is when creating a set of properties for any classes. As the time goes I discover a cheap cheat code to reduce my coding work and let some script do my repeated work for me... Here is my code to create a set of 17 properties in a class... Public Sub MakePropCode() Dim vsProp Dim vlProp Dim vbProp Dim i As Long Dim sOutPut As String ' array of string properties vsProp = Array("ISNFolder", "ISDFolder", "CSVFolder", _ "DBHost", "DBUser", "DBPassword", _ "RDBHost", "RDBUser", "RDBPassword", _ "LogPath", "DRSMHost", "DRSMID", "...