Sign In
Mark Yocom's Script Tips
Scripting tips, covering batch, VBScript, and the occasional Perl script.
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
RSS for posts
Atom
RSS for comments
OK
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
Batch
Deep Thoughts
Resources
VBScript
Archive
Archives
January 2008
(1)
August 2006
(1)
July 2006
(1)
May 2006
(1)
September 2005
(2)
June 2005
(14)
June, 2005
MSDN Blogs
>
Mark Yocom's Script Tips
>
June, 2005
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Mark Yocom's Script Tips
That's a pretty shifty argument...
Posted
over 7 years ago
by
Mark Yocom [MSFT]
1
Comments
It's pretty easy to deal with up to 9 arguments in batch through built-in variables %1 through %9 . For example: echoargs.cmd @echo off echo %1 echo %2 echo %3 echo %4 echo %5 echo %6 echo %7 echo %8 echo %9 If you feed this A B C D E F G H I, you...
Mark Yocom's Script Tips
Ignoring the output of a command
Posted
over 7 years ago
by
Mark Yocom [MSFT]
2
Comments
Earlier , I used >nul 2>&1 to suppress the output of a command, and the question was brought up as to why this was "better" than just >nul . To understand what's going on, you need to know that there are two streams of output from any...
Mark Yocom's Script Tips
Opening web pages from the command line
Posted
over 7 years ago
by
Mark Yocom [MSFT]
0
Comments
I spend a lot of time in a CMD window. I mean a lot of time. Often I'd like to open a web page, but opening up Internet Explorer and navigating my way to the page in question is such a chore. I'm lazy. I don't like mouse-clicks. Enter the quicky batch...
Mark Yocom's Script Tips
Backslashes vs. slashes - who knew?
Posted
over 7 years ago
by
Mark Yocom [MSFT]
3
Comments
Here's something I'd never noticed until today, when I discovered it quite by accident. In general, to run a program in a different directory, you specify the path with backslashes, such as C:\WINDOWS\system32\notepad.exe . This should be no surprise...
Mark Yocom's Script Tips
Bugs and assumptions
Posted
over 7 years ago
by
Mark Yocom [MSFT]
0
Comments
There's a fine line between an assumption and a bug. If the assumptions are spelled out ahead of time, then it's not a bug if the script does what's expected, taking the assumptions into consideration. Having disclaimed that, then, here are some of...
Mark Yocom's Script Tips
So what the heck just happened there...?
Posted
over 7 years ago
by
Mark Yocom [MSFT]
1
Comments
In the previous post, there was a fair amount of code and basically no explanation... Here's how it breaks down: Naïve method: set FILENAME=basename-%RANDOM% CMD has a built-in variable called %RANDOM% . Simply put, it returns a random value...
Mark Yocom's Script Tips
Creating unique filenames in a batch file
Posted
over 7 years ago
by
Mark Yocom [MSFT]
0
Comments
Someone today was asking how to create unique filenames. They had some process which ran in a loop, and they wanted to direct the output of that process to a file, but rather than always overwriting the same file, they wanted to keep history using distinctive...
Mark Yocom's Script Tips
Two quick file-manipulation scripts from the vault
Posted
over 7 years ago
by
Mark Yocom [MSFT]
2
Comments
There are a couple of scripts that have been with me since the beginning of time. I don't use them that much anymore, but they occasionally come in handy. I'm always pleasantly surprised to find that I still have them when I need them. One makes files...
Mark Yocom's Script Tips
Typos vs. muscle memory
Posted
over 7 years ago
by
Mark Yocom [MSFT]
2
Comments
It occurs to me that my mistypings of 'notepad' and 'exit' are probably more the result of muscle-memory since I type those so often. The mistakes I make are due to one hand hitting its letter before the other (correct) hand hitting its. Just a thought...
Mark Yocom's Script Tips
Laziness is a virtue
Posted
over 7 years ago
by
Mark Yocom [MSFT]
0
Comments
Some scripts are complex and do lots of cool stuff. Others are simple and save a bunch of time. I have a couple of scripts which prove to be so useful that I don't know when I'm using them anymore. I tend to type faster than I think (or get my fingers...
Mark Yocom's Script Tips
Looking through my own toolbox
Posted
over 7 years ago
by
Mark Yocom [MSFT]
0
Comments
In the beginning, there was DOS. And DOS had batch files - little scripts that ended in .BAT. So, when I started writing and collecting a few useful ones, I created a directory, C:\BELFRY in which to keep my .BATs. Get it? Bats? Belfrey? Oh, never mind...
Mark Yocom's Script Tips
Books to have at your fingertips
Posted
over 7 years ago
by
Mark Yocom [MSFT]
0
Comments
There are a couple of books that I have found to be particularly useful. Whether you're a beginner or you have your black belt in script-fu, you'll find them to be excellent references. Windows NT Shell Scripting is an excellent place to start. Tim...
Mark Yocom's Script Tips
Tools to have in your toolbox
Posted
over 7 years ago
by
Mark Yocom [MSFT]
0
Comments
The Windows 2003 Resource Kit has a number of indispensible tools. For scripting, the two handiest are sleep and robocopy. Grab these - you'll need them.
Mark Yocom's Script Tips
First Post!
Posted
over 7 years ago
by
Mark Yocom [MSFT]
0
Comments
I wonder how many first posts in blogs are given the title "First post!". I'm guessing a good 75%. So the idea behind this particular blog is this: anyone can write a script (even you!), but it takes work to write a good * script. Here you'll learn...
Page 1 of 1 (14 items)