Creating a .bat file?

  • Thread starter Thread starter Kate
  • Start date Start date
It echoes... try these:

echo Merry Christmas

echo Kate

echo Merry Christmas %username%!

These user variables continue to be in place in all NT versions, some of
them were probably in place in Windows 3.x and Windows 95, the 'ol' pros
would know this...

Batches written for NT4 will run on XP as long as they are not trying to
execute unknown or forbidden commands, and vice-versa.

If you want help with the batch file you need to reveal more of its
contents or you should reveal the source of the file. 'Delay' is not a
valid Windows command, this is probably just pinging the loopback
adapter for 30 seconds. Try this inoffensive command:

ping google.com

now get your stopwatch and time this:

ping google.com -n 29

John
 
That was interesting!
The batch file I mentioned was written so that the application could
be launched by double-clicking the .btm (in his case), then after 30
seconds, the temp files would be deleted, although the application
would still be running (I think!). However, I don`t think it is worth
going any further with this after all, as it is no big thing to just
dbl-click the batch I have at the moment and clear the files after I
close the app.

With thanks and best wishes for Christmas and 2010

Kate
 
Kate said:
Thank you very much once again, John. Works a treat.
Somebody told me that the % sign can be used instead of writing out
the whole path, but, as a complete DOS novice, I think I would rather
see the full path so that I can easily see if I have made any
mistakes.

Kate

Hi Kate,

Yes, the % sign is used in environment variables.
You could use something like this in your batch file:

del /Q "%UserProfile%\Local Settings\Temp\PTM*.tmp"
del /Q "%UserProfile%\Local Settings\Temp\t*.tmp"

This works the same on my system:

del /Q "%Temp%\PTM*.tmp"
del /Q "%Temp%\t*.tmp"

/Q is Quiet Mode - it deletes without asking if OK when using wildcards.

When I do this at Command Prompt:
echo %temp%
I get this:
C:\DOCUME~1\Richard\LOCALS~1\Temp
Which is short for:
C:\Documents and Settings\Richard\Local Settings\temp

HTH. (Hope This Helps. :)
--Richard

- - -- - -
 
Thanks for explaining this, Richard, but I finally lost all patience
with the troublesome app and uninstalled it. Apologies to you, John
and everyone else who helped me for wasting your time, although I did
learn something about batch files for future reference, so, from my
point of view, it wasn`t a wasted exercise.

Kate
 
Back
Top