Search : in
By :

Need Help in DOS Scripting

Last answer on May 19, 2009 10:48:59 am BST Kiran, on May 19, 2009 6:54:14 am BST 
 Report this message to moderators

Hello,

I need to use the follwing script as a batch file.

cd D:\
md migration
cd migration
md SourceCatalogs
md TrgtXMLs
cd..
cd Catalogs

:begin
Set /P catalog= Please Enter your catalog name :
REM check whether a catalog called %catalog%.cat exists
IF EXIST %catalog%.cat GOTO :success
IF NOT EXIST %catalog%.cat GOTO :error

:error
ECHO Error - can't find the %catalog%.cat file Enter Again
GOTO :begin

:success
copy D:\Catalogs\%catalog%.cat D:\Migration\SourceCatalogs\%catalog%.cat
C:
cd "C:\Program Files\cognos\cer5\migs7"
impcat2xml D:\migration\SourceCatalogs\%catalog%.cat D:\migration\TrgtXMLs\%catalog%.xml
del D:\migration\SourceCatalogs\*.*
pause
GOTO MENU


when I enter 1st time its works fine, after that what ever i enters it points to Not Exist only.
kindly help

Configuration: Windows XP Internet Explorer 7.0

Best answers for « Need Help in DOS Scripting » in :
[MS-Dos]List the contents of a directory in a file Show[MS-Dos]List the contents of a directory in a file Intro Explanation Intro It may be convenient to make the listing of one or more directories in a file, to make a catalog of files. Under MS-DOS (or Windows by opening a...
Basic MS-Dos commands ShowBasic MS-Dos commands Intro The command prompts: Intro Here is a list of basic commands that you can use in a DOS prompt (e.g. a using a boot disk). To have additional information about these commands, type /? after entering the...
Manage XP and Vista users using dos commands ShowManage XP and Vista users using dos commands Enabling or disabling a user Set a password Requiring a user to change password at next logon Specify if the user has the right to change his password Set the minimum length of a password for all...
Introduction to DOS ShowThe development of MS-DOS MS-DOS is the most well known operating system, the most commercialised version is that of Microsoft, christened "MS-DOS" (there are other versions such as DR-DOS). MS-DOS was created in 1981 when it was used on an IBM...
Operating Systems - Customising DOS ShowThe DOS start-up procedure is defined in the autoexec.bat and config.sys files located in the root of your "C:\" drive. We highly recommend making back up copies of these files before modifying them. To deactivate a line of command in either file...
Operating Systems - Installing MS-DOS ShowInstalling MS-DOS When installing MS-DOS, make sure that in the BIOS the the boot disk is set to A: first, then the hard drive (boot sequence: A:, C:) Then insert disk 1 in the A: drive, power up the computer, then follow the on-screen...

1

Zubair, on May 19, 2009 8:51:57 am BST

Hi

you need to create bat file

copy con file name.bat followed by the enter
enter the information in file and then press f6 for save

Reply to Zubair

2

 Kiran, on May 19, 2009 10:48:59 am BST

Hi Zubair,

Thanks for your Answer.

Actually i saved the above script as a .bat file and running.
1st time if i enter "aaa" which was not there in that path it prompts me to enter again.
But if i enter "bbb" which was there in that path it runs fine.
now again it go to menu.
Now If I enter "bbb" or "ccc" which were there in the path it needs to run but it prompts me to enter again.
So I understood that loop works fine 1st time but not later.
Any help matters.
Thanks.

Reply to Kiran