The changes include:
MAILDATE.CMD Build a message's "From" header
Added an /SUBJ switch to include the subject from the email header
with the date added.
NAMEDOWN.CMD Covert a filename to lower case
NAMEUP.CMD Covert a filename to upper case
Corrected the bug that caused a failure for filenames with
parentheses.
Added to the FAQ file 1CMDFAQ.TXT
154} How do I remove leading zeros from a string with script only?
155} How can I use command-line to open a Windows Explorer Window?
156} How does one create a stortcut using the command-line?
157} How to get the count of words and the last word of a variable?
All the best, Timo
--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html
echo %n%|findstr /r "[^0-9]">nul
if %errorlevel% GTR 0 (set isInteger=true) else (set isInteger=false)
Or this new one:
if "!n:~,1%n%!"=="%n%" (set isInteger=true)else (set isInteger=false)
Benny Pedersen
@echo off
setlocal enabledelayedexpansion
set n=^^!"=="" (cd) else echo Hello Benny ^& goto :eof
echo - Let's see what Benny's integer test says to the n set above -
if "!n:~,1%n%!"=="%n%" (set isInteger=true)else (set isInteger=false)
echo %isInteger%
It simply said something like this:
Hello Herbert. I know that you are able to see that
my new syntax is both more brief, faster and better
than the previous one using "findstr.exe",
and that one should NOT put anything into a variable n,
such as:
set n=^^!"=="" (cd) else echo Hello Benny ^& goto :eof
but one should instead input a number when asked.
(set n= input a number, or a letter: )
Anyhow, most menus in programs are NOT about
input a number to erase all data, etc... and
for my current project
(
if a number goto :number, else if it's a letter, then
something else...
), my new found: "!n:~,1%n%!"=="%n%"
is much better. I guess that you do know the bad things
about using a pipe (|), and that it's good if you could
avoid a pipe :-)
This (my) syntax: "!n:~,1%n%!"
Should do a string thing, NOT executing a syntax.!!!
What you said (me) is also that the Microsoft stuff is
bad, and programming in any other language than DOS
is more easy. DOS is the world most hard and difficult
language, that is why we prefer programming in DOS,
not C++, VBS, or whatever....
Benny,
BTW. The previous syntax from Timo would also fail
if the "findstr.exe" file is missing...
if "!n:~4!" == "" (
for /L %%I in (0,1,3) do ((set v= )
for /L %%E in (0,1,9) do if "%%E" == "!n:~%%I,1!" (set v=)
if defined v echo oops on nth %%I+1
)
) else echo Not defined n, or too long.
Benny,
PS
Herbert could execute whatever n in this: !X:~%n%,1!
so what about this: "!n:~%%I,1!"
Even if he is able to let that one fail, I would still use batch
files...
:-)
> Added to the FAQ file 1CMDFAQ.TXT
> 156} How does one create a stortcut using the command-line?
Hi Timo,
I guess that should read shortcut not stortcut ;-)
There are several other .exe programs around the net.
From these I like Shortcut.exe from Marty List because it has edit and
query modes. It should also work with all Windows versions up to w2k3.
http://www.optimumx.com/download/
In environments not allowing foreign programs, a vbscript can be used.
http://groups.google.com/groups?q=create+shortcut+vbs+group%3Aalt.msdos.batch.*
When scripting host isn't installed an inf file could be created to install
the link.
http://groups.google.de/groups?q=create+shortcut+inf+group%3Aalt.msdos.batch.*
Greetings
Matthias
> There are several other .exe programs around the net.
Thank you, Matthias. I have pointed to your useful further information.
All the best, Timo
--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Useful script files and tricks ftp://garbo.uwasa.fi/pc/link/tscmd.zip