Page 1 of 1 1
Topic Options
#98558 - 2003-02-19 03:02 AM A Little help on Permissions
Wazza Offline
Fresh Scripter

Registered: 2003-02-19
Posts: 6
New to Kixtart so bare with me please if this is a basic problem.

Using Kixtart 4.12:
When copying a file from a server to a client where the file already exists on the client - the script terminates. I want the script to overwrite the file and am using the basic copy statement with no joy. Works fine when I try on my client but not on any of the other clients. I can't get the script to delete or move a file on a client either?

code:
$FileName='<test.doc>'
$SrcPath='\\<server>\<folder>\'
$DestPath='C:\Program Files\<folder>\'
$DestFile=$DestPath+'\'+$FileName
$SrcFile=$SrcPath+'\'+$FileName
if comparefiletimes($DestFile,$SrcFile)<0 or 1-exist($DestFile)
copy $SrcFile $DestPath
endif


Top
#98559 - 2003-02-19 03:06 AM Re: A Little help on Permissions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I think the problem is about access rights.

check right after the copy line the errorcode with:
@serror get $keypress

that stops there and shows the error on console window.
_________________________
!

download KiXnet

Top
#98560 - 2003-02-19 03:11 AM Re: A Little help on Permissions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I just saw the the topic title... seems that you already saw the cause of the problem.

but that also makes me ask, what is your actual question?
if the user has no rights on the file, ofcourse he can't overwrite it.
_________________________
!

download KiXnet

Top
#98561 - 2003-02-19 03:16 AM Re: A Little help on Permissions
Wazza Offline
Fresh Scripter

Registered: 2003-02-19
Posts: 6
Thanks for the quick replies. I am guessing this is a permissions or rights issue however do not have enough experience to make the call. The odd thing is that the user DOES have permission <full control> on this file through windows - its only when executing the login script that there seems to be a permission issue
Top
#98562 - 2003-02-19 03:19 AM Re: A Little help on Permissions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
also, your call:
1-exist($DestFile)

raised some questions.
you are basically checking if the return code is 1 or not.
if you are checking if the file exists, you can remove the "1-" part.
if you want to check if it does not exist, just say:
not exist($DestFile)
_________________________
!

download KiXnet

Top
#98563 - 2003-02-19 03:20 AM Re: A Little help on Permissions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh, did you try it with the error-checking line I showed?

a possible problem can be also that the file is in use or something...
_________________________
!

download KiXnet

Top
#98564 - 2003-02-19 03:45 AM Re: A Little help on Permissions
Wazza Offline
Fresh Scripter

Registered: 2003-02-19
Posts: 6
@serror get $keypress returns a
quote:
access is denied
error. however, I again confirm the user has full rights to this file...

Top
#98565 - 2003-02-19 03:49 AM Re: A Little help on Permissions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
but does he have the right on the source?
and is the destination file in use?
_________________________
!

download KiXnet

Top
#98566 - 2003-02-19 03:52 AM Re: A Little help on Permissions
Wazza Offline
Fresh Scripter

Registered: 2003-02-19
Posts: 6
user has rights to source and destination. Also, no the file is not in use. The problem seems to be only occuring when writing to anywhere in c:\program files\
Top
#98567 - 2003-02-19 03:58 AM Re: A Little help on Permissions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
since you have spaces in the destination path, did you try adding double quotes to the begining and end of the destination path?

[ 19. February 2003, 03:59: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#98568 - 2003-02-19 04:00 AM Re: A Little help on Permissions
Wazza Offline
Fresh Scripter

Registered: 2003-02-19
Posts: 6
yes, I have tried using double quotes the paths involved.
Top
#98569 - 2003-02-19 04:04 AM Re: A Little help on Permissions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
open a DOS window and execute the DOS copy command using the values in your KiXtart program. what happens?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#98570 - 2003-02-19 04:08 AM Re: A Little help on Permissions
Wazza Offline
Fresh Scripter

Registered: 2003-02-19
Posts: 6
works perfectly in DOS - tried that this morning
Top
#98571 - 2003-02-19 02:18 PM Re: A Little help on Permissions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Print the line you are executing to verify that it is attempting what you expect.

code:
? 'copy $SrcFile $DestPath'
Get $

when the script stops with theis on the screen compare it to the DOS command that worked. Is it the same?

Copy it and try it in another DOS window.

[ 19. February 2003, 14:19: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


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

Who's Online
0 registered and 202 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.065 seconds in which 0.024 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