OT Can you run batch files in Windows XP

J

John S.

I was hoping it would be possible to run simple batch files in
Win XP to do simple file management jobs.

What I want to do at the moment is to take a saved copy of
Outlook Express's Inbox and use a batch file to overwrite the
existing Inbox.dbx with this saved copy. (This is for use by
elderly students learning how to use Outlook Express, and the
idea is to have some standard messages in the Inbox when they
start the programme).

I've tried writing simple experimental batch files in Notepad and
saving with a .bat extension, but they don't seem to work when
double clicked. I see a black window open momentarily, but it
closes before its contents can be seen by the human eye!

I find that I can open Windows XP's command prompt window and
type in typical DOS commands there, and they work. What I need
is some way of running a script from an icon that can use these
commands.

Would be grateful for any ideas.

John Selby
 
L

Lester Horwinkle

Can do? Yes.

But DOS/Windows (former) lack of a decent batch language has been solved
(for quite some time now).

Use Windows scripting host. Write code in VB script. Well supported. Well
documented. Vastly superior to DOS .bat files. Easy to learn. And free.
 
B

Bill Yerkes

Batch files work fine in XP. The flash you see is due to the way you run
them. As you already noted, when you open a Command Prompt window, you can
run the batch file AND see it. The problem with clicking a windows icon for
a batch file is that the job (CMD.exe and the batch file) runs then
immediately closes the window. Hence the flash.

There are other ways to do what you want such as the aforementioned Windows
Script. However, if the batch file works, it's hard to argue with success.
 
K

Klein

PERL - activestate.com
CSL - C Scripting Language - sourceforge.com

Both are cross platform, well supported, powerful, quick.
 
T

tfog

(e-mail address removed) (John S.) wrote in @news.paradise.net.nz:
I was hoping it would be possible to run simple batch files in
Win XP to do simple file management jobs.

What I want to do at the moment is to take a saved copy of
Outlook Express's Inbox and use a batch file to overwrite the
existing Inbox.dbx with this saved copy. (This is for use by
elderly students learning how to use Outlook Express, and the
idea is to have some standard messages in the Inbox when they
start the programme).

I've tried writing simple experimental batch files in Notepad and
saving with a .bat extension, but they don't seem to work when
double clicked. I see a black window open momentarily, but it
closes before its contents can be seen by the human eye!

I find that I can open Windows XP's command prompt window and
type in typical DOS commands there, and they work. What I need
is some way of running a script from an icon that can use these
commands.

Would be grateful for any ideas.

John Selby
Place a "pause" line at the end of the batch file and the command window
will remain open allowing you to see what was executed.
 
B

Bjorn Simonsen

John S. wrote in said:
Win XP [...]

Right-click the batch file, create a shortcut. Then right click the
resulting shortcut and select properties. In the properties dialog
find the Shortcut tab, and there the Target field.
Lets say the Target field currently reads:
C:\bin\acf.bat
then just add the following in front of it, cmd /k, so it reads
cmd /k C:\bin\acf.bat

This will force the command shell (CMD) to keep running (/k) after the
batch file has finished, where it normally will close. This way you
can see the output from the batch job on screen, the CMD window will
stay open until you close it.

More questions, please ask in a batch group. On Usenet you can find at
least 3 groups dedicated to batch and CMD script issues:

For NT (2k and XP): <and <
For MS-DOS and Win9x: <
Tip: Timo Salmi offers a handy collection of links to several batch
and commandline related web sites (both DOS/9x and NT/XP/2k) at
<http://www.uwasa.fi/~ts/http/http2.html#batch>.

He is also author of the two batch file how-to collections below:

For MS-DOS/Win9x:
<ftp://garbo.uwasa.fi/pc/link/tsbat.zip>
tsbat.zip Useful MS-DOS batch files and tricks, T.Salmi

For Win NT/2k/XP:
<ftp://garbo.uwasa.fi/pc/link/tscmd.zip>
tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi

a PS for the curios, my acf.bat file reads:
START Opera "http://google.com/groups?&as_ugroup=alt.comp.freeware"

All the best,
Bjorn Simonsen
 
B

Bjorn Simonsen

Bjorn Simonsen wrote in said:
Right-click the batch file, create a shortcut

Forgot to add: when done editing the shortcut, use(click) the shortcut
(*.lnk) instead of the *.bat file when you want to
run the batch file this way. If you click the bat file only,
cmd window will close on exit as before. You can copy/move the
shortcut anywhere you want, desktop, start menu, quick launch
menu...different directory....etc

All the best
Bjorn Simonsen
 
J

John S.

Bjorn Simonsen said:
John S. wrote in said:
Win XP [...]

Right-click the batch file, create a shortcut. Then right click the
resulting shortcut and select properties. In the properties dialog
find the Shortcut tab, and there the Target field.
Lets say the Target field currently reads:
C:\bin\acf.bat
then just add the following in front of it, cmd /k, so it reads
cmd /k C:\bin\acf.bat
snip ..

Many thanks for the helpful comments Bjorn, and others who
offered advice.

Must have been an error in my batch file. Back to the drawing
board.

Regards, John S.
 
R

Rhexis

PERL - activestate.com
CSL - C Scripting Language - sourceforge.com

Heh. The guy is looking for something to create simple backups
and you offer him Perl? :/
 
G

gonzo

John S. said:
I was hoping it would be possible to run simple batch files in
Win XP to do simple file management jobs.

What I want to do at the moment is to take a saved copy of
Outlook Express's Inbox and use a batch file to overwrite the
existing Inbox.dbx with this saved copy. (This is for use by
elderly students learning how to use Outlook Express, and the
idea is to have some standard messages in the Inbox when they
start the programme).

I've tried writing simple experimental batch files in Notepad and
saving with a .bat extension, but they don't seem to work when
double clicked. I see a black window open momentarily, but it
closes before its contents can be seen by the human eye!

I find that I can open Windows XP's command prompt window and
type in typical DOS commands there, and they work. What I need
is some way of running a script from an icon that can use these
commands.

Would be grateful for any ideas.

John Selby
Hop over to alt.windows98 and ask Shep. Or try
alt.os.windows-xp, but put on a flame-proof jacket
first.
 
P

Phred

I was hoping it would be possible to run simple batch files in
Win XP to do simple file management jobs.

What I want to do at the moment is to take a saved copy of
Outlook Express's Inbox and use a batch file to overwrite the
existing Inbox.dbx with this saved copy. (This is for use by
elderly students learning how to use Outlook Express, and the
idea is to have some standard messages in the Inbox when they
start the programme).

I've tried writing simple experimental batch files in Notepad and
saving with a .bat extension, but they don't seem to work when
double clicked. I see a black window open momentarily, but it
closes before its contents can be seen by the human eye!

I find that I can open Windows XP's command prompt window and
type in typical DOS commands there, and they work. What I need
is some way of running a script from an icon that can use these
commands.

Suggest you ask in alt.msdos.batch.nt which covers XP too.

(Don't be fooled by the obvious lineage Win9x/ME/XP -- if you ask
about XP in alt.msdos.batch the net cops will take you away. ;-)


Cheers, Phred.
 
A

Alastair Smeaton

you mean something like this ?

CD C:\SOPHIDE
DEL *.IDE
DEL IDES.EXE
Url2File http://www.sophos.com/downloads/ide/ides.exe ides.exe
IDES.EXE
COPY /Y *.IDE C:\Progra~1\Sophos~1\
NET STOP SWEEPSRV.SYS
NET START SWEEPSRV.SYS

I use this to update sophos virus files -it works, but is quick -
sometimesyou see the window for a few secs, but with a smaller one,
the window would disappear.

What happens with your batch file ? does it do the job, or are you
simply wanting the window to stay opern affter it has done its work.

PS - mine is a simple text file with .bat extension
 
J

John Hood

Lester said:
Can do? Yes.

But DOS/Windows (former) lack of a decent batch language has been solved
(for quite some time now).

Use Windows scripting host. Write code in VB script. Well supported. Well
documented. Vastly superior to DOS .bat files. Easy to learn. And free.


Snipped;


Lester:

I'm a dos man from waaaay back (some time before the Flood.) I took a
look at Windows Script Host a few years ago. Could never find a simple
"Here's how you build one" explanation. Just reams and reams of "Teach
yourself basic programming with WSH."

Do you know of anything like this? Or a "How to" guide for an old batch
file writer? Or is it no longer possible to teach an old dog new tricks?

John Hood E-mail: (e-mail address removed) Website: John's Best of Freeware:
http://home.wi.rr.com/johnhood/freeware/
 
F

Frank Bohan

John S. said:
I was hoping it would be possible to run simple batch files in
Win XP to do simple file management jobs.

I use some simple bat files in XP which work OK if run via a shortcut rather
than clicking them directly.

===

Frank Bohan
¶ Eggheads unite! You have nothing to lose but your yolks.
 
K

Klein

Heh. The guy is looking for something to create simple backups
and you offer him Perl? :/

PERL ---> executes xyz backup program with cmomand line parms, then checks
output, takes other actions, etc. Lots of examples.
 
R

Rhexis

PERL ---> executes xyz backup program with cmomand line parms, then
checks output, takes other actions, etc. Lots of examples.

Thank you. I know what Perl is. I'm just saying that offering it to
someone who's just looking for something simple is, well, cruel at best.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top