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 Questions involving Unix to Windows (Desktop or Server) go here. Any Windows/DOS questions should go here as well.

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 07:38 AM
rename the file in batch reldb UNIX for Advanced & Expert Users 7 01-14-2008 03:43 PM
batch file ramneek High Level Programming 3 11-09-2005 02:48 AM
batch file ramneek IP Networking 1 11-08-2005 08:09 AM
Batch file update cfoxwell UNIX for Dummies Questions & Answers 4 10-04-2001 01:50 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-11-2008
Registered User
 

Join Date: Jan 2008
Posts: 7
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.
Reply With Quote
Forum Sponsor
  #2  
Old 07-12-2008
Registered User
 

Join Date: May 2008
Location: Maryland, USA
Posts: 27
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.
Reply With Quote
  #3  
Old 07-13-2008
Registered User
 

Join Date: Jan 2008
Posts: 7
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.
Reply With Quote
  #4  
Old 07-13-2008
Registered User
 

Join Date: May 2008
Location: Maryland, USA
Posts: 27
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 04:34 PM. Reason: Typo
Reply With Quote
  #5  
Old 07-13-2008
Registered User
 

Join Date: Jan 2008
Posts: 7
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.
Reply With Quote
  #6  
Old 07-13-2008
Registered User
 

Join Date: May 2008
Location: Maryland, USA
Posts: 27
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.
Reply With Quote
  #7  
Old 08-28-2008
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.?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0