[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
- Subject: Re: Problem Using CALL to DOS Copy using Wildcards
- From: "Chitty, David" <DPChitty@HOMESIDE.COM>
- Date: Tue, 2 Apr 2002 14:51:09 -0500
The copy works if I code the full file name as in Prasanna's example.
However, when I use the wildcard because I could have one to many files
(number and names unknown except for extension), the copy will not work.
For example, the following will work:
let $copy_command = 'copy ' || 'c:\temp\WO196808.POS ' || $InputFile
call system using $copy_command #copy_status WAIT
but the following will not work:
let $copy_command = 'copy ' || 'c:\temp\*.POS ' || $InputFile
call system using $copy_command #copy_status WAIT
I tried Prasanna's idea of double-quotes (below is a sample) but without
success. I believe the key is getting the system to accept the wildcard.
let $copy_command = getenv('COMSPEC') || ' /c copy ' || '""c:\temp\*.POS""
""c:\temp\hlnabchs.pos""'
I also tried Daniel Mueller's suggestion of using the /Y (and even /-Y)
parameter of the cmd.exe. Neither worked. The error I am receiving is as
follows (you can see the expanded command as well):
Copy Command: C:\WINNT\system32\cmd.exe /c /y copy c:\temp\*.POS
c:\temp\hlnabchs.pos
Copy Status: 255.000000
Dave Chitty
-----Original Message-----
From: Prasanna Menta [SMTP:pmenta@umuc.edu]
Sent: Tuesday, April 02, 2002 2:24 PM
To: sqr-users@list.iex.net
Subject: Re: Problem Using CALL to DOS Copy using Wildcards
Hello David,
This is an example of call system code to merge two files, you are
missing the quotes, see if this is of use to you
let $merge = getenv('COMSPEC') || ' /C copy ' || '""C:\TEMP\FILE1""
+
""C:\TEMP\file2"" ""C:\TEMP\FILE3""'
call system using $merge #status
Thanks
Prasanna
"Chitty, David" wrote:
>
> 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.