HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Software Newsgroups > Windows XP

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 05-18-2007, 03:37 PM
VexedFist
 
Posts: n/a
Default Batch files in Win XP

I am trying to write a bath file for use in Windows XP.
Here is what I have now:

CD\
CD..
cd Temp Data Files
cd Raw Data
del lexall
del lexall.out
rename lexall.txt lexall.
9005LEX.EXE

I need to change the lexall.txt file name to include a user variable:

1234567_lexall.txt

The Number 1234567 needs to be input by the user every time.
Does anybody have any ideas?

Any and all suggstions will be welcome.

Reply With Quote
Sponsored Links
  #2  
Old 05-18-2007, 04:16 PM
John Hensley
 
Posts: n/a
Default Re: Batch files in Win XP

On 18 May 2007 07:37:12 -0700, VexedFist <RalphMHill@aol.com> wrote:

>I am trying to write a bath file for use in Windows XP.
>Here is what I have now:
>
>CD\
>CD..
>cd Temp Data Files
>cd Raw Data
>del lexall
>del lexall.out
>rename lexall.txt lexall.
>9005LEX.EXE
>
>I need to change the lexall.txt file name to include a user variable:
>
>1234567_lexall.txt
>
>The Number 1234567 needs to be input by the user every time.
>Does anybody have any ideas?
>
>Any and all suggstions will be welcome.


Here is an example of a batch file that should do what want. You need
to specify the number on the command line such as "MyBatchFile 12345".
If the user doesn't pass anything on the command line it will display
an error message.

if "%1"=="" goto error
cd "\Temp Data Files\Raw Data"
del lexall
del lexall.out
ren lexall.txt %1_lexall
9005LEX.EXE
@goto end
:error
@echo You must specify a number on the command line
:end


John Hensley
www.resqware.com
Reply With Quote
  #3  
Old 05-18-2007, 06:01 PM
VexedFist
 
Posts: n/a
Default Re: Batch files in Win XP

This just opens and closes the window too fast to see.
If I added a pause (see below):

if "%1"=="" goto error
pause
cd "\Temp Data Files\Raw Data"
del lexall
del lexall.out
ren lexall.txt %1_lexall
9005LEX.EXE
@goto end
:error
@echo You must specify a number on the command line
pause
:end
echo off

This is what shows in the cmd window:

C:\Temp Data Files\Raw Data>if "" == "" goto error
you ,ust specify a number on the command line

C:\Temp Data Files\Raw Data>pause




On May 18, 10:16 am, John Hensley wrote:
> On 18 May 2007 07:37:12 -0700, VexedFist <RalphMH...@aol.com> wrote:
>
>
>
>
>
> >I am trying to write a bath file for use in Windows XP.
> >Here is what I have now:

>
> >CD\
> >CD..
> >cd Temp Data Files
> >cd Raw Data
> >del lexall
> >del lexall.out
> >rename lexall.txt lexall.
> >9005LEX.EXE

>
> >I need to change the lexall.txt file name to include a user variable:

>
> >1234567_lexall.txt

>
> >The Number 1234567 needs to be input by the user every time.
> >Does anybody have any ideas?

>
> >Any and all suggstions will be welcome.

>
> Here is an example of a batch file that should do what want. You need
> to specify the number on the command line such as "MyBatchFile 12345".
> If the user doesn't pass anything on the command line it will display
> an error message.
>
> if "%1"=="" goto error
> cd "\Temp Data Files\Raw Data"
> del lexall
> del lexall.out
> ren lexall.txt %1_lexall
> 9005LEX.EXE
> @goto end
> :error
> @echo You must specify a number on the command line
> :end
>
> John Hensleywww.resqware.com- Hide quoted text -
>
> - Show quoted text -



Reply With Quote
  #4  
Old 05-18-2007, 07:00 PM
Poprivet
 
Posts: n/a
Default Re: Batch files in Win XP

http://en.wikipedia.org/wiki/Crossposting


Reply With Quote
  #5  
Old 05-18-2007, 07:15 PM
VexedFist
 
Posts: n/a
Default Re: Batch files in Win XP

POP,

This batch file worked previously with just the "lexall.txt" file name.
However we are upgrading our reprorting now.
Our reports generate with the "Company Number" followed by an "Undescore"
and then the "lexall.txt" file name.
(i.e., if a company has a number of 3456888 then the report is called
3456888_lexall.txt).

We need to strip the (Company Number and Underscore, as well as the file
suffix [.txt]) before starting the 9005LEX.EXE program.

The 9005LEX.EXE program requires the input file (to be name lexall, with no
file type) to run correctly.

Pop all this batch file needs to do is rename a file and run the 9005LEX.EXE
program
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
need software to batch print Joseph O'Brien Digital Photo 5 05-02-2007 08:21 PM
Undo batch rename Andre De Clercq Windows XP 2 04-26-2007 10:02 PM
Batch file won't run unless I'm logged on Ed Flecko Windows XP 1 04-26-2007 02:58 AM
xcopy using batch file Logie Bear Windows XP 4 04-19-2007 03:58 PM
batch watermark software? peter Digital Photo 3 04-04-2007 01:11 AM


All times are GMT. The time now is 02:21 PM.


Powered by vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger