Page 1 of 1 1
Topic Options
#163722 - 2006-06-27 03:49 PM Creating a directory during copy
jscibelli Offline
Lurker

Registered: 2005-07-08
Posts: 3
I want to copy files to users 'C' drive when they login. The directory that I am copying to may not exist initially. My understanding from the documentation is that as long as I specify the target with a trailing backslash the directory will be created if it does not exist. This is not working. The test code is:
IF @WKSTA="nyoscibeljxp"
copy "\\homeclaims\source\link_2002.mde" "c:\access frontend\"
copy "\\homeclaims\source\LOC Database.lnk" "c:\Documents and Settings\" + @userid + "\Desktop\*.*"
ENDIF

The "access frontend" directory is not being created.
Can anyone help?
Thanks in advance

Top
#163723 - 2006-06-27 03:57 PM Re: Creating a directory during copy
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I don't see a trailing backslash, I see "\*.*"
You should never hard code @UserID in the path.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#163724 - 2006-06-27 04:06 PM Re: Creating a directory during copy
jscibelli Offline
Lurker

Registered: 2005-07-08
Posts: 3
Les,
Its the first copy statement that I'm having the problem with. The target is
"C:\Access frontend\".
Thanks
Joe

Top
#163725 - 2006-06-27 04:28 PM Re: Creating a directory during copy
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Do your users have the right to create the folder at the root of C:?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#163726 - 2006-06-27 05:21 PM Re: Creating a directory during copy
jscibelli Offline
Lurker

Registered: 2005-07-08
Posts: 3
The security settings for 'C' look OK.
Top
#163727 - 2006-06-28 01:51 AM Re: Creating a directory during copy
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Well it does look as though KiXtar is not copying the files correctly due to what it thinks is some type of syntax error.

Code:
Break On

'KiXtart version is: ' + @KiX ?
'About to copy file from UNC...' ?
copy "\\msef001\shared\TEST.TXT" "c:\unc\"
'Copy UNC File Error was: ' + @ERROR + ' - ' + @SERROR ?
??
'About to copy file from LOCAL DRIVE...' ?
copy "C:\MYSCRIPTS\myscript.kix" "c:\local\"
'Copy LOCAL File Error was: ' + @ERROR + ' - ' + @SERROR ?
??
'About to copy file from MAPPED DRIVE...' ?
copy "F:\Al\PPTMSE.ppt" "c:\mapped\"
'Copy MAPPED File Error was: ' + @ERROR + ' - ' + @SERROR ?



Gives me this result.
Code:
KiXtart version is: 4.52 Release Candidate 2
About to copy file from UNC...
Copy UNC File Error was: 123 - The filename, directory name, or volume label syntax is incorrect.


About to copy file from LOCAL DRIVE...
Copy LOCAL File Error was: 123 - The filename, directory name, or volume label syntax is incorrect.


About to copy file from MAPPED DRIVE...
Copy MAPPED File Error was: 123 - The filename, directory name, or volume label syntax is incorrect.



Will do some more testing to see what I can determine.

Even if I add wildcards or full path for SOURCE and DESTINATION I get errors and it won't copy the files.

This is a beaut...

Code:
'KiXtart version is: ' + @KiX ?
'About to copy file from UNC...' ?
copy "\\msef001\shared\TEST.TXT\" "c:\unc\TEST.TXT"
'Copy UNC File Error was: ' + @ERROR + ' - ' + @SERROR ?



Gives a result of this:
Code:
KiXtart version is: 4.52 Release Candidate 2
About to copy file from UNC...
Copy UNC File Error was: 0 - The operation completed successfully.



However it did not create a folder or copy the file either one, so to me that is a bug. In theory it said to copy nothing to TEST.TXT and it said it did, but no TEST.TXT file was created or copied either one.

Top
#163728 - 2006-06-29 01:30 PM Re: Creating a directory during copy
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Can you perform the same tasks from the Command Interpreter? That would help isolate it as either a KiXtart or OS problem.
_________________________
There are two types of vessels, submarines and targets.

Top
#163729 - 2006-06-29 06:58 PM Re: Creating a directory during copy
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
No because CMD.EXE does not support creating directories on the fly with the copy command alone.

Aside from that yes it's just a normal file copy and works fine.

KiXtart though does not. As a moderator perhaps you could take a few moments to confirm or deny this issue.

Top
#163730 - 2006-06-29 11:28 PM Re: Creating a directory during copy
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Some of my findings:
1) Non-existing folders are not being created if COPY is used to copy a specific file
2) Non-existing folders are being generated if COPY is used to copy a whole directory AND only ONE subfolder is missing
3) Non-existing folders are NOT being generated if more than one level of folders is missing

Code:

'KiXtart version is: ' + @KiX ?
'About to copy file from UNC...' ?

; this will fail
copy "\\sensei\d$\test\test.txt" "d:\unc\TEST.TXT"
'Copy UNC File Error was: ' + @ERROR + ' - ' + @SERROR ?

md "d:\unc\"
'MD Error was: ' + @ERROR + ' - ' + @SERROR ?

; this will succeed
copy "\\sensei\d$\test\" "d:\unc\test.txt\"
'Copy UNC File Error was: ' + @ERROR + ' - ' + @SERROR ?

; this will fail
copy "\\sensei\d$\test\" "d:\unc\deep\test.txt\"
'Copy UNC File Error was: ' + @ERROR + ' - ' + @SERROR ?

_________________________
There are two types of vessels, submarines and targets.

Top
#163731 - 2006-06-30 12:34 AM Re: Creating a directory during copy
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
So then I think it's safe to say that we should report this as a bug in even the current RC2 version of KiXtart.
Top
#163732 - 2006-06-30 01:08 AM Re: Creating a directory during copy
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
It looks like a bug, it sounds like a bug, it smelles like a bug, it'll be squished like a bug
_________________________
There are two types of vessels, submarines and targets.

Top
#163733 - 2006-07-12 02:37 PM Re: Creating a directory during copy
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Excellent find, good work!

What happens is that single file COPY's to a non-existing directory fail. Wildcard COPY's to the same dir work fine.

I'm afraid the issue is too late for 4.52, but I'll make sure it will be fixed in the next update.

Thanks again!

Ruud

Top
#163734 - 2006-07-14 08:44 AM Re: Creating a directory during copy
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
A bit off, but using "c:\Documents and Settings\" + @userid + "\Desktop\*.*" won't work half of the time, since the userid in the actual path can sometimes be user.network or user.network.000 best practice would be to use %userprofile% for the actual curent path and then use %userprofile%\Desktop.
Top
#163735 - 2006-10-09 09:37 PM Re: Creating a directory during copy
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Now working in KiXtart 4.53

Code:
KiXtart version is: 4.53
About to copy file from UNC...
Copy UNC File Error was: 0 - The operation completed successfully.


About to copy file from LOCAL DRIVE...
Copy LOCAL File Error was: 0 - The operation completed successfully.


About to copy file from MAPPED DRIVE...
Copy MAPPED File Error was: 0 - The operation completed successfully.


Top
Page 1 of 1 1


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

Who's Online
0 registered and 1429 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.054 seconds in which 0.019 seconds were spent on a total of 12 queries. Zlib compression enabled.

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