Kerkhoff
(Fresh Scripter)
2007-01-10 01:45 PM
COPY folder or file with blanks

I want to copy to a folder and a file name with spaces.

example
copy from c:\temp\ordrer.pdf to "u:\net\order archive\ordrer 715204.pdf"

How do I do this with kixtart COPY?

Also, I cannot use COMPAREFILETIMS, if the path includes spaces


Mart
(KiX Supporter)
2007-01-10 05:05 PM
Re: COPY folder or file with blanks

The blanks are left alone when you put the file (including the path) in between quotes.
This works just fine for me.

Code:
Break on

Copy "d:\test folder\test file1.txt" "d:\test folder\test file3.txt"
$rc = CompareFileTimes("d:\test folder\test file1.txt", "d:\test folder\test file3.txt")

?$rc
Sleep 5


Sealeopard
(KiX Master)
2007-01-11 06:13 AM
Re: COPY folder or file with blanks

Or assign the file names to variables first.

Kerkhoff
(Fresh Scripter)
2007-01-11 09:33 AM
Re: COPY folder or file with blanks

When i type it manuelly with "", then it works.

But when I assign the path to a variable, then it won't accept it with "" - regardless if the path includes spaces or not.

Example:
$from = 'C:\TEMP\DOK.PDF'
$to = '"\\filsrv\archive folder\dok 23170 PETERSEN.PDF"'

copy $from $to (don't work)

copy $from "\\filsrv\archive folder\dok 23170 PETERSEN.PDF" (works fine)


Glenn BarnasAdministrator
(KiX Supporter)
2007-01-11 04:02 PM
Re: COPY folder or file with blanks

You have quotes inside quotes, so the file name is "\\filsrv\archive folder\dok 23170 PETERSEN.PDF", not \\filsrv\archive folder\dok 23170 PETERSEN.PDF

Use single or double quotes, not both. Personally, I use single quotes in kix unless I'm printing a contraction (I'm, Can't, etc), especially when calling DOS type commands that require double quotes.

Glenn


NTDOCAdministrator
(KiX Master)
2007-01-12 01:13 AM
Re: COPY folder or file with blanks

There is also an FAQ on using quotes when / where / why