editlinks.vbs (week #25)

Wednesday, June 19, 2013 Labels: ,
This utility modifies specified shortcut (.lnk) file's paths, including the target, directory, icon, and sometimes description.

There is no usage information provided by the script itself, so here it is:

USAGE:
  editlinks.vbs [/s] [--path C:\path] "replace" "with" ["replace" "with"] ...

This will update all paths:
  • Target — the application linked to
  • Start in — the starting directory
  • Icon — the location of the icon
It will also empty the description property/field if it matches (exactly) the Target.

Here is an example:

    $ editlinks.vbs --path "C:\new-bin" "C:\old-bin" "C:\new-bin"

This will change all shortcuts that point to 'C:\old-bin' to point instead to 'C:\new-bin'.

NOTE: When retrieving the TargetPath from a shortcut, it will (sometimes?) expand any environment variables already in it. This will cause the number of changed files to seem quite large (and never go down).

Check out the source code at GitHub!

attr.exe (week #24)

Tuesday, June 11, 2013 Labels: ,
A simple utility to view and modify file attributes.. There are three main benefits of this utility over Windows' built-in attrib.exe.
  • The order in which you alter the attributes does not matter. For instance, you don't have to explicitly remove -r before -s, etc.
  • You can combine attributes as in: `attr -rsh file`.
  • You can modify multiple files via the same command-line as in: `attr -sa file1 file2 +hs file3`.
Here are the details:

USAGE: attr.exe [options] [file] [file..n] [options file..n] ...

  no-arguments    Displays attributes for all files (and
                  directories) in the current directory.

  file            Specifies a file (or file wildcard) for attr 
                  to process.

OPTIONS:

    +     Sets an attribute.
    -     Clears an attribute.

    r     Read-only file attribute.
    a     Archive file attribute.
    s     System file attribute.
    h     Hidden file attribute.

  /p --pause      Pause when finished.
  /r --recursive  Processes matching files in the current 
                  directory and all sub-directories. (also /s)
  /d              Processes directories as well.
                  (sorry this isn't implemented yet!)

     --showpath   Output each file's full path and name.
                  Default is file name only (without the path).
EXAMPLES:

  $ attr -h -s desktop.ini
    Removes the hidden and system attributes from desktop.ini.

  $ attr -hs +a desktop.ini
    Removes the hidden and system attributes from
    and adds the archive attribute to desktop.ini.

  $ attr -r +hs -a desktop.ini +hs folder.jpg
    Removes the readonly and archive attributes from and adds the
    hidden and system attributes to desktop.ini.
    Removes the archive attribute and adds the hidden and system
    attributes to folder.jpg.

  $ attr /s -h -s desktop.ini
    Removes the hidden and system attributes from desktop.ini in
    the current and all sub-directories.

Check out the source code at GitHub!

createpw.exe (week #23)

Tuesday, June 4, 2013 Labels: ,
This is a simple utility to create unique passwords from a key (such as a website name) and a master password. The idea for the code came from ss64.com.

USAGE: createpw.exe [options] [key|site-name]

  key|site-name      Any unique key that you will remember.
                     If you’re using this for a website, put in
                     the url (such as: amazon or amazon.com).
                     If omitted, you will be prompted for it.

OPTIONS: 

  --clip             Put the newly created password onto the clipboard. 
                     This is the default behavior.
  --no-clip          Output the new password to the console.
  --no-symbols       Do not output symbols in the new password.

When it asks for the user name, you can just press enter to bypass/skip it. JUST be sure that you are consistent in supplying a user name with keys or not.

Here are a couple of examples:

    $ createpw amazon.com
    Enter the username:         user
    Enter the master password:  ********

    password = (put into clipboard)

    $ createpw
    Enter the site name or key: amazon.com
    Enter the username:         user
    Enter the master password:  ********

    password = (put into clipboard)

    $ createpw --no-clip
    Enter the site name or key: amazon.com
    Enter the username:         user
    Enter the master password:  ********

    password = #ZJ~EEUmXuYVdMEMUK7CVbgxqY

For the last example I typed `12345678` for the password. You should get the same result!

Check out the source code at GitHub!

sortxml (week #22)

Tuesday, May 28, 2013 Labels: ,
This is a very simple utility that prettifies and sorts xml file nodes and attributes.

It is simple to use.


USAGE: sortxml.exe [options] infile [outfile]

  infile      The name of the file to sort, etc.
  outfile     The name of the file to save the output to.
              If this is omitted, then the output is written to stdout.

OPTIONS:

  --pretty    Ignores the input formatting and makes the output look nice.
  --sort      Sort both the nodes and attributes.
  --sortnode  Sort the nodes.
  --sortattr  Sort the attributes.

(prefix an option with ! to turn it off.)

The default is to output pretty and sorted nodes and attributes. So, given the following:

    $ type sample.xml
    <root><node attr="name" value="one"></node></root>
Would output the following:

    $ sortxml.exe sample.xml
    <root>
        <node attr="name" value="one">
        </node>
    </root>
I created this utility so I can use it as a File Format in Beyond Compare. Here is the gist of the File Format in BC3.

    Helpers\sortxml.exe --pretty --sortnode --!sortattr %s %t

Check out the source code at GitHub!

menustack (week #21)

Tuesday, May 21, 2013 Labels: ,
menustackA nifty dynamically loaded menu, one menu item per file, useful for docking onto your taskbar for easy access to lots of applications/shortcuts.

It also includes a search field at the top, so when the menu opens you can immediately start typing to filter out menu items.

It is simple to use.

Just create a shortcut (link) to the menustack.exe file. Then edit the shortcut properties, specifically the target. This is the default syntax:

    menustack.exe --f filepattern filepath

The options are:

    --f filepattern

Specifies the files to show in the menu. This is generally a wildcard, such as *.exe, *.lnk, *.sln, etc.

    filepath

Specifies the directory to look for the files to include. This can be anywhere on your system. Be sure to include paths with spaces within double-quotes.

Here is an example:

    "...\MenuStack.exe" --f *.lnk "%UserProfile%\Dropbox\Shortcuts"

This will create a menu item for each file (*.lnk) in the Shortcuts directory.

File system details:

The files in filepath are automatically sorted alphabetically. However, you can customize that also. You can basically separate the sort key from the displayed menu text (file name) using the `]` symbol. For instance, in the screen shot above, the menu items are not alphabetical. This is because the files (the .lnk files) are named as follows:

    10] Chrome – Default.lnk
    10] Chrome (Profile 2).lnk
    10] Chrome (Profile 3).lnk
    20] Beyond Compare.lnk
    30] Sublime Text.lnk
    30] Visual Studio 2013.lnk
    50] Personal Projects.lnk
    60] Putty.lnk
    61] Winamp.lnk

It works pretty well. The search/filter is extremely inefficient and a bit wonky. But, it does the job!

Check out the source code at GitHub!

seth (week #12)

Tuesday, March 19, 2013 Labels: , ,

» display environment variables

A simple DOS command-line (CLI) utility displays the environment variables in a nicely formatted list.

Check out the source code on GitHub!

------------------------- All Environment Variables -------------------------
__DOSKEY_HISTORYFILE = C:\Users\Kody\.doskey_history
__DOSKEY_MACROFILE = C:\Users\Kody\.doskey_macros
ALLUSERSPROFILE = C:\ProgramData
AMDAPPSDKROOT = C:\Program Files (x86)\AMD APP\
...

ascii (week #11)

Tuesday, March 12, 2013 Labels: , ,

» display all ascii characters

A simple DOS command-line (CLI) utility that displays all of the ascii characters.

Check out the source code on GitHub!

C:\>ascii.exe
000 001 ☺ 002 ☻ 003 ♥ 004 ♦ 005 ♣ 006 ♠ 007 008
009 010 011 ♂ 012 ♀ 013 014 ♫ 015 ☼ 016 ► 017 ◄
018 ↕ 019 ‼ 020 ¶ 021 § 022 ▬ 023 ↨ 024 ↑ 025 ↓ 026 →
027 ← 028 ∟ 029 ↔ 030 ▲ 031 ▼ 032 033 ! 034 " 035 #
036 $ 037 % 038 & 039 ' 040 ( 041 ) 042 * 043 + 044 ,
045 - 046 . 047 / 048 0 049 1 050 2 051 3 052 4 053 5
054 6 055 7 056 8 057 9 058 : 059 ; 060 < 061 = 062 >
063 ? 064 @ 065 A 066 B 067 C 068 D 069 E 070 F 071 G
072 H 073 I 074 J 075 K 076 L 077 M 078 N 079 O 080 P
081 Q 082 R 083 S 084 T 085 U 086 V 087 W 088 X 089 Y
090 Z 091 [ 092 \ 093 ] 094 ^ 095 _ 096 ` 097 a 098 b
099 c 100 d 101 e 102 f 103 g 104 h 105 i 106 j 107 k
108 l 109 m 110 n 111 o 112 p 113 q 114 r 115 s 116 t
117 u 118 v 119 w 120 x 121 y 122 z 123 { 124 | 125 }
126 ~ 127 ⌂ 128 Ç 129 ü 130 é 131 â 132 ä 133 à 134 å
135 ç 136 ê 137 ë 138 è 139 ï 140 î 141 ì 142 Ä 143 Å
144 É 145 æ 146 Æ 147 ô 148 ö 149 ò 150 û 151 ù 152 ÿ
153 Ö 154 Ü 155 ¢ 156 £ 157 ¥ 158 ₧ 159 ƒ 160 á 161 í
162 ó 163 ú 164 ñ 165 Ñ 166 ª 167 º 168 ¿ 169 ⌐ 170 ¬
171 ½ 172 ¼ 173 ¡ 174 « 175 » 176 ░ 177 ▒ 178 ▓ 179 │
180 ┤ 181 ╡ 182 ╢ 183 ╖ 184 ╕ 185 ╣ 186 ║ 187 ╗ 188 ╝
189 ╜ 190 ╛ 191 ┐ 192 └ 193 ┴ 194 ┬ 195 ├ 196 ─ 197 ┼
198 ╞ 199 ╟ 200 ╚ 201 ╔ 202 ╩ 203 ╦ 204 ╠ 205 ═ 206 ╬
207 ╧ 208 ╨ 209 ╤ 210 ╥ 211 ╙ 212 ╘ 213 ╒ 214 ╓ 215 ╫
216 ╪ 217 ┘ 218 ┌ 219 █ 220 ▄ 221 ▌ 222 ▐ 223 ▀ 224 α
225 ß 226 Γ 227 π 228 Σ 229 σ 230 µ 231 τ 232 Φ 233 Θ
234 Ω 235 δ 236 ∞ 237 φ 238 ε 239 ∩ 240 ≡ 241 ± 242 ≥
243 ≤ 244 ⌠ 245 ⌡ 246 ÷ 247 ≈ 248 ° 249 ∙ 250 · 251 √
252 ⁿ 253 ² 254 ■

enlarge (week #8)

Tuesday, February 19, 2013 Labels: , ,

A simple DOS command-line (CLI) utility that enlarges the command prompt window to the largest possible size (based on the current/active screen). Just like shrink, this is a super simple utility and hardly any code, but I use it frequently every day!

Check out the source code on GitHub!

shrink (week #7)

Tuesday, February 12, 2013 Labels: , ,

A simple DOS command-line (CLI) utility that shrinks the current command prompt window to 80x24. And, that's all it does! It is a super simple utility and hardly any code, but I'm always surprised just how often I use it!

I checked it into GitHub a while back, but forgot to make the entry into my blog.. oh well. Here it is now.

Check out the source code on GitHub!

cldesc (week #6)

Tuesday, February 5, 2013 Labels: , ,

Cleans and sorts a descript.ion file, removing entries that no longer exist with a couple of other options too..

Check out the source code on GitHub!

USAGE:
cldesc.exe [options] [file]

--vf Remove entries where the entry does not exist.*
--sf Save a backup copy of the `descript.ion` file.*
--oc Output to the console instead of to the source file. This only
works when a <file> is specified.

* These items can be set as environment variables using:
> set cldescrip_<arg>=true|false

[file] Specify the file to clean up. If a file is not specified, assumes
`descript.ion` in the current directory.
A file (or content) can be piped to `cldesc` via stdin. In such
cases the output will always be sent to stdout.

EXAMPLES:
Sort the `descript.ion` file in the current directory, updating the file's
contents.
> cldesc.exe

Sort `file.txt` and output the results to the console.
> type file.txt |cldesc

ebook_compiler (week #5)

Tuesday, January 29, 2013 Labels: , ,

This is a simple utility that converts .md (markdown) files to html. It then combines them into one .html file.

The real benefit of this is that I can separate my book into separate files. As many or as few as I want. I currently have split up my little book into chapters and sub-sections; one file each.

This little utility will only convert md files that have changed, into html. Once all html files are up to date, they are combined into a single file and wrapped inside the template.

It supports a settings file (_ebook_config.txt) and a html template file (_ebook_template.txt).

_ebook_config.txt
title=My book title
ext=*.md

The template file is really just an html file. Use @SPLIT@ to indicate in the template where the book contents will be. See the examples folder in the code for details.

This is not a markdown to html compiler: It relies upon markdown.pl (a Perl script) available from daring fireball for the actual conversion.


Check out the source code on GitHub!


It is definitely a work in progress, but it does what I need for the book I'm working on. And, it is 100 times faster than editing a single md file and converting the whole thing every time.

gitstatus (week #3)

Tuesday, January 15, 2013 Labels: , , ,

» Displays an interactive Git status on the command-line.

Check out the source code and downloads on GitHub!

This is a simple application that allows you to get the status of your Git directory interactively. What I mean by interactively is you can diff files* and mark files for adding right from the command-line.

*In order to diff files you must create a Git alias named 'difftool' that opens/launches an external application to perform the diff. If the alias does not open a different tool (something other than the built in 'diff' command, it will be ignored and lock-up the gitstatus application.

Currently, it only works on modified files. It won't let you add files that are not already part of the repository. I only felt that this utility was needed when modifying files, etc. Let me know, if you would like it extended or fork it yourself!

Yes, it is very quick and dirty. However, it works nicely for what it was made for!

gitstatus is released using the MIT License, see LICENSE.txt for details.

Windows CE file scanner

Wednesday, July 5, 2006 Labels: , , ,
I created a utility a while back for getting specific file details that LDHM doesn't already get. Someone asked for it on the LANDesk forums, so I took my lunch hour today and made it available on my web-site.

When run on a Windows CE-based device, it will scan specified folders and/or files and output the information to an LDMS-based BNF file (plain-text). It contains no user-interface, but works very nicely. Check it out

http://www.wasatchwizard.com/downloads/ScanFiles.aspx

Keywords: LANDesk, LDMS, LDHM, Handheld Manager, ldscnhlp.ini, ldappl
Older Posts