18 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Reverend Jim

I have a Chromecast that I use to stream video from my laptop to our TV. It works great, however, until VLC (Videolan) releases their promised upgrade with Chromecase support, I am limited to streaming files in the mp4 format. Fortunately, ffmpeg allows me to convert other formats to mp4. …

Member Avatar for gladisfogson
1
2K
Member Avatar for Reverend Jim

vbScript - Extending Application Functionality with vbScript and AutoIt Sometimes you'll find that one of your favourite applications is missing some useful functionality. For me, it was FastStone Image Viewer. I've had to scan a large number of family photos to convert everything to digital. Rather than scan one photo …

1
3K
Member Avatar for Reverend Jim

vbScript - Create a Log File Using vbScript Classes Before I retired I was responsible for most of the corporate data plumbing at our control centre. All of the plumbing was written in vbScript. As any maintenance programmer knows, log files are a vital key in identifying and fixing problems. …

0
3K
Member Avatar for Reverend Jim

##vbScript - Run an External Program and Capture the Output Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. When you want to execute an external program for a particular result (such as resizing an image, as shown in a previous snippet) you can simply use …

Member Avatar for Reverend Jim
1
11K
Member Avatar for Reverend Jim

Over the last few days I have been converting old video files from avi to mp4. I've been doing this using the command line version of DivX. This is the process behing the DivXPro GUI and it is named `DivXEngine.exe`. Converting video files takes a big hit on the CPU …

1
2K
Member Avatar for Reverend Jim

##vbScript - An Application to Modify srt Subtitle Files Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. So far I've posted either functions/subs or code snippets to illustrate a technique. This time I am going to post a complete application. First, a few points. 1. …

0
843
Member Avatar for Reverend Jim

##vbScript - Some Useful String Functions Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. vbScript provides a number of functions for manipulating strings. I find that a few more simple functions would have made things a lot simpler. For example, I find myself checking to …

Member Avatar for SN Technologies
1
1K
Member Avatar for Reverend Jim

##vbScript - Identify File by Perceived Type Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. There are times when you want to operate on all files of a given type. For example, you may want to enumerate all files in a folder or a drive …

1
932
Member Avatar for Reverend Jim

##vbScript - Get Drive Letter by Volume Label Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. I have all my computers partitioned with two partitions. The drive letters are C (OS and applications) and D (user data). I use Macrium Reflect to take monthly full …

1
4K
Member Avatar for Reverend Jim

##vbScript - Browse for Folder or File Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. Some scripts need input (other than from the command line) from the user. This can be read from the console (StdIn) or from a pop-up textbox (InputBox). This is fine …

0
14K
Member Avatar for Reverend Jim

##vbScript - Convert Integer to Binary String Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. vbScript has a number of functions for converting from one type to another. These functions are named C<type> as in CInt (convert to int), CDbl (convert to double), etc. There …

0
4K
Member Avatar for Reverend Jim

##vbScript - Sorting With and Without Code Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. Sorting is something that must be done from time to time. I'm going to examine three ways. The first is the well known (at least by name) QuickSort method. Rather …

1
1K
Member Avatar for Reverend Jim

This is the first in (hopefully) a series of posts about vbScript. Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. My wife and I take a lot of pictures. Naturally, we end up sending pictures to friends through email. I find it is unnecessary, and …

2
1K
Member Avatar for Reverend Jim

This code generates an ascii maze of up to size 30x30. If you try to generate a larger maze then you will likely run out of stack space. There is no way to increase the size of the stack in vbscript. Each cell in the maze is represented by a …

Member Avatar for Reverend Jim
0
599
Member Avatar for Reverend Jim

Over the years I've seen a lot of discussion (and several implementations) of the Quicksort algorithm. Most of what I have seen, unfortunately, lacks sufficient commenting as well as meaningful variable names. Hopefully the following vbScript code will more clearly show how Quicksort actually works. A couple of incidental notes: …

Member Avatar for Reverend Jim
1
2K
Member Avatar for Reverend Jim

An often underused control from vb.Net is the FolderWatch control. But sometimes you need to throw something together that doesn't need a fancy GUI. Or perhaps the task seems too trivial to go to the hassle of coding it up in vb.Net (or C#). Because the FolderWatcher is built on …

1
1K
Member Avatar for Reverend Jim

A while back I came across an article that mentioned genetic algorithms. For those unfamiliar with the term, simply put, rather than finding a solution to a problem by iterating over all possible cases, a genetic algorithm attempts to find a solution by starting with a guess, then generating a …

Member Avatar for Web_4
2
1K
Member Avatar for Reverend Jim

I find that I occasionaally have special projects where it would be nice to have a context menu for files. I tend to write housekeeping scripts and it is convenient to be able to run these scripts against one or more files at a time without having to navigate and …

0
1K

The End.