A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Batch files in Win XP



 
 
Thread Tools Display Modes
  #1  
Old May 18th 07, 03:37 PM posted to microsoft.public.windowsxp.general
VexedFist
external usenet poster
 
Posts: 3
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.

Ads
  #2  
Old May 18th 07, 04:16 PM posted to microsoft.public.windowsxp.general
John Hensley
external usenet poster
 
Posts: 18
Default Batch files in Win XP

On 18 May 2007 07:37:12 -0700, VexedFist 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
  #3  
Old May 18th 07, 06:01 PM posted to microsoft.public.windowsxp.general
VexedFist
external usenet poster
 
Posts: 3
Default 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 Dataif "" == "" goto error
you ,ust specify a number on the command line

C:\Temp Data Files\Raw Datapause




On May 18, 10:16 am, John Hensley wrote:
On 18 May 2007 07:37:12 -0700, VexedFist 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 -



  #4  
Old May 18th 07, 07:00 PM posted to microsoft.public.windowsxp.general
Poprivet
external usenet poster
 
Posts: 1,503
Default Batch files in Win XP

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


  #5  
Old May 18th 07, 07:15 PM posted to microsoft.public.windowsxp.general
VexedFist
external usenet poster
 
Posts: 3
Default 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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 07:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.