Archives for: 2007

12/15/07

Permalink 03:24:23 pm, by dave Email , 457 words, 3461 views   English (US)
Categories: Windows Scripting, Wsh Scripts

Displaying File Information using VBS and the FileSystemObject

While working on a script that enumerates the files in the startup folder, I wanted to list certain information about a file, create time, last access time, last modified time, and the file's attributes. This can be done fairly easily using the Scripting.FileSystemObject. Here is a function that will list the basic information about a file.

Read more! »



Did you like this post? If so, Share it!  del.icio.us digg reddit slashdot this article Facebook Twitter MySpace Email

12/14/07

Permalink 10:44:15 am, by dave Email , 188 words, 118 views   English (US)
Categories: Windows Scripting, Wsh Scripts

Show Shortcut Target Paths with VBS

I was working on a script to
enumerate what files were being executed in the startup folder
. To do this, I needed to determine what executables were pointed to from the shortcut (.lnk) files that were in the startup folder. Here is a function that wraps everything up and will return the target path for the shortcut.

Read more! »



Did you like this post? If so, Share it!  del.icio.us digg reddit slashdot this article Facebook Twitter MySpace Email
Permalink 10:37:06 am, by dave Email , 190 words, 90 views   English (US)
Categories: Windows Scripting, Wsh Scripts

Expanding environmental variables using vbs

Recently I was messing around with some registry enumeration scripts to show the paths of executables that were being referenced in the registry. To do this properly, I needed to expand the system variables that were stored in the registry. I figured that there might be some other folks that needed to do the same thing, so here is a little function that will handle it for you.

Read more! »



Did you like this post? If so, Share it!  del.icio.us digg reddit slashdot this article Facebook Twitter MySpace Email

07/21/07

Permalink 08:03:01 am, by dave Email , 457 words, 336 views   English (US)
Categories: Windows Scripting, Batch Scripts

Windows Command Script to Create a WinAmp Playlist

I spend a lot of time listening to my mp3 collection. I have always just told WinAmp to play a folder, but this gets problematic if you have music in multiple locations.

So I threw together this Windows command file to get the contents of a directory and write the full path of those files to an output file, in m3u format. By default the script will append to the end of whatever output file that is passed in. The script expects to be looking for mp3 files, but you can change that by updating the FILEEXT variable to whatever you want it to be.

Read more! »



Did you like this post? If so, Share it!  del.icio.us digg reddit slashdot this article Facebook Twitter MySpace Email

04/13/07

Permalink 06:46:04 pm, by dave Email , 335 words, 154 views   English (US)
Categories: Windows Scripting, Wsh Scripts

Simple MSSQL WHERE Sample

Every so often, I need to put together a script to do some simple database queries or updates and I can never remember the proper format of the connection string and I have to go look it up somewhere. So this post is an attempt to solve that for myself. I figure I will always be able to find this sample, regardless of how I organize or reorgnize my local storage.

This is a simple MSSQL sample that performs a count based on a where clause.

Read more! »



Did you like this post? If so, Share it!  del.icio.us digg reddit slashdot this article Facebook Twitter MySpace Email

02/11/07

Permalink 06:43:19 am, by dave Email , 863 words, 177 views   English (US)
Categories: Windows Scripting, Wsh Scripts

Showing Service Information using VBS and ADSI

Here is a fairly straight forward example of enumerating all the services on a window's machine using ADSI.

If you wanted to bind to the machine you are querying with different credentials, you could replace the getobject call in the showServices subroutine with an opendsobject call.

Read more! »



Did you like this post? If so, Share it!  del.icio.us digg reddit slashdot this article Facebook Twitter MySpace Email

02/04/07

Permalink 08:04:20 am, by dave Email , 584 words, 161 views   English (US)
Categories: Windows Scripting, Wsh Scripts

Setting a File's Read Only Bit using Windows Scripting

I was looking at the process of setting file attributes using the attrib command in a batch file and I thought it would be much better if I could do this using a wsh script instead.

Here is a quick sample of setting a file's read only attribute using vbs.

Read more! »



Did you like this post? If so, Share it!  del.icio.us digg reddit slashdot this article Facebook Twitter MySpace Email

Scripts

This is somewhere I can post interesting snippets as I come across them. Hopefully some folks out there will find this helpful.

Search

Follow Me:

Misc

Who's Online?

  • Guest Users: 1

powered by b2evolution free blog software