SYSTEM command on Windows XP systems

Kenneth Brody kenbrody at bestweb.net
Tue Feb 22 09:51:36 PST 2005


Nancy Palmquist wrote:
[...]
> SYSTEM "copy /b /v /y "< folder1{"/"{filename{"."{3 < folder2{"/"{newfilename
> 
> system "del /f "< folder1{"/"{filename{"."{3<" > nul"
> 
> The del did not work.

The first question I have is are you using forward-slashes in the
filename, as shown in the example?  Unless XP is "smarter" than
previous versions of Windows, you cannot do that, as it will see
this as a command line flag indicator.

> Now I had tried aa=remove(folder1{"/"{filename{"."{3)  first which did
> not work so I resorted to the system commands.

Does field 3 have trailing spaces?  If so, you need to remove them:

    aa=remove(folder1{"/"{filename{"."{3{"")

> Now when they did not work, I wrote the two commands to a file with a
> .bat extension.  I then execute that file.  The del still does not work.

Is the file still open?  Unlike *nix, Windows cannot delete a file
which is open.

> If I go to the batch file and execute it without filePro, it will work
> perfectly  with the copy and then the delete.

Sounds like the problem was that the file was still open.  Once you
exited filePro to run the .bat file, the file was closed, and so the
del was able to succeed.

> Can anyone tell me what issues I am hitting  that would keep it from
> working correctly in filePro?  I am extremely puzzled.
> 
> (I will be attempting to use the MOVE command instead.  I will let you
> know if that works any better.  I am changing the name of the file as
> part of the copy and changing the folder also, so RENAME will not work.)

MOVE won't work any better than COPY/DEL if the file is still open.  On
the other hand, it may work much better once the file is closed.  (If the
destination is on the same filesystem, a MOVE doesn't need to copy the
file contents.)

-- 
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody        | www.hvcomputer.com |                             |
| kenbrody/at\spamcop.net | www.fptech.com     | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap at gmail.com>




More information about the Filepro-list mailing list