Visual Basic: The Registry Made Easy

VBA Hacker A Classy Way to Bypass the Awkward Registry API By Romke Soldaat Compared with the bad old INI files, the Windows registry is not only a safer place for system and application settings, it also offers more ways to store different types of data, and lets you organize your settings in a hierarchical manner. But, unlike the straightforward functions that deal with INI files, the registry API is more complex. You can’t just read and write data with a single function call – you must open a key before you can access it, and close the key when […]

Read more

Visual Basic Coding Conventions

These guidelines are used by Microsoft to develop samples and documentation. The Visual Basic Language Specification does not define a coding standard. Coding conventions create a consistent look to the code, so that readers can focus on content, not layout. Conventions let the readers understand the code more quickly, because it allows them to make assumptions based on previous experience. Conventions make copying, changing, and maintaining the code easier. Conventions demonstrate Visual Basic "best practices." Discussion Naming Conventions Naming guidelines are covered in Design Guidelines for Developing Class Libraries. You do not have to change the name of objects created […]

Read more

PS: Directory Listing

Command to list all Files greater than a specified file size: PS D:> Dir $env:windir | Where-Object { $_.Length -gt 10MB }     Directory: C:Windows Mode                LastWriteTime     Length Name —-                ————-     —— —- -a—         3/18/2011  11:00 PM  262189444 MEMORY.DMP PS D:>   Format the File listing by the File sizes in KB, MB, GB’s:   PS D:> Dir $env:windir | Where-Object { $_.Length -gt 1MB } | Format-Table Name, { [int]($_.Length/1MB) } -Auto Name                   [int]($_.Length/1MB) —-                  ———————- explorer.exe                               2 MEMORY.DMP                               250 ntbtlog.txt                                1 setupact.log                               3 WindowsUpdate (1).log                      2 WindowsUpdate.log                          1 wweb32.dll                                 1 PS D:>   Display matching Files with sizes […]

Read more