The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
.
google unix.com



Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Telnet in batch file aemunathan UNIX for Dummies Questions & Answers 1 05-09-2008 11:38 AM
rename the file in batch reldb UNIX for Advanced & Expert Users 7 01-14-2008 06:43 PM
batch file ramneek High Level Programming 3 11-09-2005 05:48 AM
batch file ramneek IP Networking 1 11-08-2005 11:09 AM
Batch file update cfoxwell UNIX for Dummies Questions & Answers 4 10-04-2001 05:50 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-12-2008
chssastry chssastry is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 16
variable in dos batch file

Sir
I have a very old cobol programme (source not availble). On execution and invoking some menu commands, depending upon the "pressed menu commands" it is writing certain values into a dos batch file. At the end of cobol file, this batch file gets exeuted.

On keying in the Drive from which you want to copy: I typed B (I have configured my pen-drive as "B".

The batch file gets written as under:

if exist zone%2\v@* del zone%2\v@*
COPY b:\%1 ZONE%2\v@2 > nul

On execution of this batch file

The file is not getting copied from B (pen drive) - PATH NOT FOUND is the message appears on screen.

How to sort this issue? Please help me. Thanks in anticipation.
  #2 (permalink)  
Old 07-12-2008
KenJackson KenJackson is offline
Registered User
  
 

Join Date: May 2008
Location: Maryland, USA
Posts: 107
B:\ is (or was) usually either the second floppy drive, if the PC had two, or the same floppy drive as A:\, but DOS would prompt you for the other floppy disk if you specified B:.

But now you are saying B:\ is your pendrive? Can you access files on the pendrive from a command shell (i.e. a "DOS prompt" window)? That is, if you type the command
dir B:\
does it show you the files there?

If B:\ is awkward to use, the DOS SUBST command may be useful for you. That is, if you want it to access files in C:\ZONEFILES instead of B:, you could use this command:

subst B: C:\ZONEFILES

Then any program or command that accesses B: will really access C:\ZONEFILES.
  #3 (permalink)  
Old 07-13-2008
chssastry chssastry is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 16
Sir, Thanks for your reply.
As I stated earlier, the values "if exist zone%2\v@* " and "COPY b:\%1 ZONE%2\v@2 > nul " are being written to the dos batch file from a cobol programme (the source not available). The earlier command of batch echo "zone%2\v@ " is displaying the Zone number and the name of the file from B:\Zone1\(file name). For another command it is displaying the contents of file from B:\Zone1. It is in fact accessing the pen drive - whose drive name has been changed to B). But when it comes to copying it to the folder in hard disk, "path not found" is the message.

Is it that the path has to be set for B:\ (pen drive) also in "environment vairable"? If so, how?
Please help me.
  #4 (permalink)  
Old 07-13-2008
KenJackson KenJackson is offline
Registered User
  
 

Join Date: May 2008
Location: Maryland, USA
Posts: 107
What is the current drive and directory when the application starts?
Is it started from a shortcut that changes the starting path?
Does the COBOL application change the current path?

The DOS command COPY b:\%1 ZONE%2\v@2 is copying to a subdirectory in the current directory of the current drive. It sounds like that directory is what's missing.

Last edited by KenJackson; 07-13-2008 at 08:34 PM.. Reason: Typo
  #5 (permalink)  
Old 07-13-2008
chssastry chssastry is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 16
Sir, Thanks once again for prompt reply.
The current path when the relevant "dos batch file" is accessed by cobol.exe is c:\abc. On the basis of user-input, if he choses " A" or "B" drive, the values are written to the dos batch file and that drive is accessed wherein some files are sought to copied to c:\abc\nnn1 (or 2) directory. As per the batch file, it is echoing the zone directory to where the file is to be copied and the file name to be copied in the B: drive. It is also reading inside the file and displaying the contents of the file in B drive. Then it will display "Do you want to copy Y/N". When we press Y it displays "Path not find" and comes out of application. I am on Windows xp. Regret for bothering toomuch. But cant help.
  #6 (permalink)  
Old 07-13-2008
KenJackson KenJackson is offline
Registered User
  
 

Join Date: May 2008
Location: Maryland, USA
Posts: 107
Try creating some directories and then running the command:

mkdir c:\abc\ZONE1
mkdir c:\abc\ZONE2

Another thing you might consider is directly modifying a copy of the binary COBOL program. I know you don't have the source, but there is a chance you could find the text of the batch file in the executable and very carefully edit it (a copy!) with either a hex editor or a text editor that will not change line ending characters.

If those don't work, I'm out of ideas.
  #7 (permalink)  
Old 08-29-2008
praveen.1 praveen.1 is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 3
variable in dos batch file

Is there any chance the directory u want to access in ur pen-drive has a space in its name...

like b:\New Folder...something like this.. space between.?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:40 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0