Page 1 of 1 1
Topic Options
#172621 - 2007-01-10 01:45 PM COPY folder or file with blanks
Kerkhoff Offline
Fresh Scripter

Registered: 2005-07-22
Posts: 9
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

Top
#172629 - 2007-01-10 05:05 PM Re: COPY folder or file with blanks [Re: Kerkhoff]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4668
Loc: The Netherlands
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
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#172678 - 2007-01-11 06:13 AM Re: COPY folder or file with blanks [Re: Mart]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11163
Loc: Boston, MA, USA
Or assign the file names to variables first.
_________________________
There are two types of vessels, submarines and targets.

Top
#172681 - 2007-01-11 09:33 AM Re: COPY folder or file with blanks [Re: Sealeopard]
Kerkhoff Offline
Fresh Scripter

Registered: 2005-07-22
Posts: 9
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)

Top
#172692 - 2007-01-11 04:02 PM Re: COPY folder or file with blanks [Re: Kerkhoff]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4351
Loc: New Jersey
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
_________________________
Actually I am a Rocket Scientist! \:D

Top
#172701 - 2007-01-12 01:13 AM Re: COPY folder or file with blanks [Re: Glenn Barnas]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11614
Loc: CA
There is also an FAQ on using quotes when / where / why
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 312 anonymous users online.
Newest Members
Thechadpma, CestMoi, MeMyselfAndI, Praveer, Ollero
17745 Registered Users

Generated in 0.031 seconds in which 0.012 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org