[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Problem Using CALL to DOS Copy using Wildcards



You receive an error? What does the error say?

My guess is that when you wildcard the filename,
it is probably PROMPTing you with an
"are you sure you want to do this?" type of message.

It may work when you do the DOS command because PROMPTING
might be turned off when you open a MS-DOS window.

Most command languanges have a command that turns off the
interactive mode when you want to run something via batch
and you want it to work no matter what
In DOS, the parameter is
/Y

In a DOS window, do a
COPY /?
to receive help on the copy command.

Microsoft(R) Windows 95
   (C)Copyright Microsoft Corp 1981-1995.

C:\WINDOWS>copy /?
Copies one or more files to another location.

COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination
  [/A | /B]] [/V] [/Y | /-Y]

  source       Specifies the file or files to be copied.
  /A           Indicates an ASCII text file.
  /B           Indicates a binary file.
  destination  Specifies the directory and/or filename for the new file(s).
  /V           Verifies that new files are written correctly.
  /Y           Suppresses prompting to confirm you want to overwrite an
               existing destination file.
  /-Y          Causes prompting to confirm you want to overwrite an
               existing destination file.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line

To append files, specify a single file for destination, but multiple files
for source (using wildcards or file1+file2+file3 format).

C:\WINDOWS>


> -----Original Message-----
> From: Chitty, David [SMTP:DPChitty@HOMESIDE.COM]
> Sent: Tuesday, April 02, 2002 12:41 PM
> To:   SQR-USERS@list.iex.net
> Subject:      Problem Using CALL to DOS Copy using Wildcards
>
> I am issuing a CALL in an SQR to copy multiple files into one file.  The
> command works fine from the DOS prompt.  It also works from the SQR if I
> provide the full name for one of the files.  However, when I use the
> wildcard (WO*.POS)to reference all of the files, I receive an error.
>
> The program code is as follows:
>
>   let $InputFile    = 'c:\temp\hsnabchs.POS'
>   let $copy_command = getenv('COMSPEC') || ' /c copy ' || 'c:\temp\WO*.POS
> '
> || $InputFile
>
>   call system using $copy_command #copy_status WAIT
>
> I also tried replacing copy with xcopy (the rest of the command line was
> left as is).  It accepted the command but prompted me with a pop-up window
> (which I don't want) requesting an F or D to indicate whether a file or
> directory was being created.
>
> Any ideas?
>
>
> Dave Chitty
>
>
> This message may contain confidential information. We provide customer
> information to others only under certain circumstances, and based on
> representations that each applicable customer has authorized the
> disclosure.
> If any person makes a false or misleading representation to obtain
> customer
> information, that person may have committed a federal crime, and we may
> report any such incidence to the proper authorities. If you receive this
> in
> error, please notify the sender by reply fax or email and delete this
> message. If you properly received this message, you may use and distribute
> it only in accordance with our instructions and applicable law.  HomeSide
> and it's affiliates do not represent, warrant or guarantee that the
> integrity of this communication has been maintained nor that the
> communication is free of errors, viruses or interference.