Page 1 of 2 12>
Topic Options
#47011 - 2003-10-19 08:17 PM DEL command not deleting read-only files
Everyone Offline
Getting the hang of it

Registered: 2003-10-19
Posts: 81
Loc: Beale Air Force Base, CA
The Kix DEL command does not seem to want to delete any files marked as read-only.
No error is returned, the file marked for deletion in the script simply doesn't get deleted.

For example, the file test.txt is read-only
The Kix command:
DEL "test.txt"
Will not delete the file, nor will
DEL "test.txt" /h

In order to delete the file, I have to use
shell "cmd /c del test.txt /a:r"

Is there a way to delete read-only files without having to use a shell command?

Top
#47012 - 2003-10-19 08:28 PM Re: DEL command not deleting read-only files
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Which version of kix are you using?

Version 4.22 (RC1 for now) supports the deletion of read only files.

Quote from the 4.22 manual:
quote:

DEL can now delete read-only files ('/f')

_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#47013 - 2003-10-19 09:53 PM Re: DEL command not deleting read-only files
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
SETFILEATTR should do it before the file Deletion.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#47014 - 2003-10-19 11:06 PM Re: DEL command not deleting read-only files
Everyone Offline
Getting the hang of it

Registered: 2003-10-19
Posts: 81
Loc: Beale Air Force Base, CA
Using 3.63, the version that comes with the NT/2000 resource kit.

Unfortunately I can't upgrade to a beta version. (not authorized to do so)
Also I have no easy way to upgrade. Kix is loaded to each workstation via a batch file at first logon, then several kix scripts are called from the batch file. (just how it was set up long before I got there)

I'll try that SETFILEATTR command.

Top
#47015 - 2003-10-19 11:13 PM Re: DEL command not deleting read-only files
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Please read ABC's of KiXtart board etiquette and message to new forum users , especially Section F.

KiXtart v3.63 is no longer under developemnt and has been superseeded by KiXtart v4.21 with KiXtart v4.22-RC1 the current release candidate.

Therefore, the KiXtart DEL command is behaving as designed and documented for KiXtart v3.63.

It is also recommended to use KiXtart v4.x under Windows 2000/XP/2003 as v3.63 has only limited support for these platforms, e.g. some of the macros will not be set correctly.

Finally, KiXtart v4.x is required for full AD functionality.
_________________________
There are two types of vessels, submarines and targets.

Top
#47016 - 2003-10-19 11:19 PM Re: DEL command not deleting read-only files
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
There are many ways to upgrade when each computer has the binaries loaded locally.

You definitely should get off of 3.x version.

See the posts in http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=2;t=003344#000000
for some ideas. I believe the FAQ forum also some ideas as well MCA's web site.

I check for the proper verion each and every logon and can uipgrade all client anytime. My web site also has some logon script design thoughts.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#47017 - 2003-10-19 11:22 PM Re: DEL command not deleting read-only files
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Even if a beta or RC version is not allowed to be the operational version of kix on your net (which is understandable) you should at least dump 3.x and switch to 4.21. Just like some posts above said better support for the newer OS's and it's the current released version.

If each wksta gets kix copied to it's local drive using a bat file implementing 4.21 should not be that difficult. Just delete the old file(s) and copy the new. No uninstall or install required.

Hopefully 4.22 will be released soon.

[ 19. October 2003, 23:30: Message edited by: R2D2 ]
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#47018 - 2003-10-19 11:54 PM Re: DEL command not deleting read-only files
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
If you follow our advice and switch to 4.21 this should do the trick.

code:
?"Kix version: " + @kix
$rc = GetFileAttr ("c:\test.txt")
?"Error: " + @error + " / " +@SERROR
?"Current attribute settings: " + $rc
Select
Case $rc <> 32
SetFileAttr ("c:\test.txt", 32)
?"Error: " + @error + " / " +@SERROR
Del ("c:\test.txt")
?"Error: " + @error + " / " +@SERROR
Case $rc = 32
Del ("c:\test.txt")
?"Error: " + @error + " / " +@SERROR
EndSelect
Sleep 5

The error checking, kix version and the sleep 5 are there just to see if it completes like it should. All the attribute values are documented in the manual. 32 is archive only, 33 is archive and read only, etc…
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#47019 - 2003-10-19 11:54 PM Re: DEL command not deleting read-only files
Everyone Offline
Getting the hang of it

Registered: 2003-10-19
Posts: 81
Loc: Beale Air Force Base, CA
I am aware of all that. It's more not being allowed to upgrade, than not knowing how to.

I appologize for not mentioning the version of Kixtart being used before. As far as the rest of "Section F". For security reasons, I cannot disclose any further details on my network environment.

Aside from waiting on permission to upgrade, I have limitations on upgrading. (SMS and other simular options are beyond my control)

Pretty much the only option I have for upgrading is via the login scripts themselves.

This is a very large network (over 5000 users), with a few dozen different login scripts depending on where users are assigned to. (trying to consolidate this mess down into one script)

A batch file cannot determine the version of Kixtart alread installed on the system. A Kixtart script can determine which version is running, however it cannot copy a new version over the top of itself, because kix32.exe will be in use while the script is running. (actually it can do this, but only if the upgrade code is at the very end of a script, and only one script is being run, however several scripts are currently being run at once)

Version determination is very important due to the volume of users on the network. Having a batch script blindly replace existing Kixtart files every time a user logs on, would result in unacceptable amounts of network traffic during peak logon times (shift changes), and could potentially cause many other problems.

I am considering having a text file copied along with the Kixtart files, and having the batch script copy the newer Kixtart files only if the text file is not present. This is the only feasable option I have been able to come up with thus far. Only obstacle in that is sorting through the mess of login scripts left by those who came before me.

So I'm stuck with 3.63 until authorization is given to upgrade, and must make due with features availible within it until then.

Top
#47020 - 2003-10-19 11:58 PM Re: DEL command not deleting read-only files
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You need to read my batch file. It is the second post of the link I posted above. I use a CRC32 check and replace any file that is not what it should be (version or otherwise.)

[ 20. October 2003, 02:32: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#47021 - 2003-10-20 12:01 AM Re: DEL command not deleting read-only files
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
quote:

A batch file cannot determine the version of Kixtart already installed on the system.

Yes and no.
We copy a kix.421 file along with the kix files to all our wksta at logon if necessary. The logon.bat files can check for file existence and copy the new files if the file you have it check for is not found.

The script I posted above also works fine with 3.63.

And actually kix doesn’t need to be installed, just copied [Wink]

[ 20. October 2003, 00:05: Message edited by: R2D2 ]
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#47022 - 2003-10-20 12:06 AM Re: DEL command not deleting read-only files
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Or, depending on how fast your network is, don't even bother copying the executable to the clients. Just dump everything into the NETLOGON share. Then you don't have to worry whether a client has an incorrect version, no Kixtart at all, or whether somebody tries to break the login script. Granted it adds about 300k of traffic for each user, but, unless you're using dial-up or ISDN, you should be fine with this. It will also make version control easier.

The FAQ Forum contains multiple threads about this.

[ 20. October 2003, 00:24: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#47023 - 2003-10-20 12:06 AM Re: DEL command not deleting read-only files
Everyone Offline
Getting the hang of it

Registered: 2003-10-19
Posts: 81
Loc: Beale Air Force Base, CA
Thanks, didn't catch that the first time I read it. Only saw the O/S version checking.

Very good idea with the /D switch on the xcopy command, didn't even think of that one.

That should work very good.

Thanks again.

Top
#47024 - 2003-10-20 12:20 AM Re: DEL command not deleting read-only files
Everyone Offline
Getting the hang of it

Registered: 2003-10-19
Posts: 81
Loc: Beale Air Force Base, CA
Yeah, it would be much easier like that, I've thought of that option before. ;-)

Bandwith isn't that much an issue... however with over 5000 users, mass amounts of open sessions on a server causes problems with the server.

Open sessions on the server often remain, even after the program has stopped running. So you end up with a bunch of workstations connected to your servers, not doing anything, but not letting other workstations do anything either. Some times clearing the sessions will fix it, some times you have to reboot.

I had a small one-way messaging program being run off of a file server on each workstation via login script once. After the program was loaded into memory, the workstations weren't releasing there sessions on the file share. There was no reason the sessions should be kept open, and not every workstation kept them open, but enough of them did to keep crashing it. Ended up having to copy the program to each workstation, instead of running it off the server.

Probably wouldn't be a problem in a smaller environment.

Wasn't very fun.

quote:

Or, depending on how fast your network is, don't even bother copying the executable to the clients. Just dump everything into the NETLOGON share. Then you don't have to worry whether a client has an incorrect version, no Kixtart at all, or whether somebody tries to break the login script. Granted it adds about 300k of traffic for each user, but, unless you're using dial-up or ISDN, you shoudl eb fine with this. It will also make verison control easier.

The FAQ Forum contains multiple threads about this.

--------------------
Jens


Top
#47025 - 2003-10-20 12:22 AM Re: DEL command not deleting read-only files
Everyone Offline
Getting the hang of it

Registered: 2003-10-19
Posts: 81
Loc: Beale Air Force Base, CA
Did I say "installed"? I meant copied. ;-)

quote:
And actually kix doesn’t need to be installed, just copied


Top
#47026 - 2003-10-20 12:23 AM Re: DEL command not deleting read-only files
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
The session was kept open because the executable loaded from the server was in use. In the case of a login script, however, the executables would be closed after a couple of seconds, thus releasing that particular session again.
_________________________
There are two types of vessels, submarines and targets.

Top
#47027 - 2003-10-20 12:31 AM Re: DEL command not deleting read-only files
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
No matter if you choose to run kix from netlogon or locally on the system it will call scripts from netlogon so you will always have a session open until the kix process is completed.

We had some problems with the kix executable getting corrupt for some strange unknown reason after a few months when ran from netlogon so nobody would get the script executed at logon. For this reason we decided to copy kix to the local drive. Affects only the specific wksta when the kix executable gets damaged.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#47028 - 2003-10-20 12:40 AM Re: DEL command not deleting read-only files
Everyone Offline
Getting the hang of it

Registered: 2003-10-19
Posts: 81
Loc: Beale Air Force Base, CA
That's weird.

Correct, always going to have sessions open. However, they should close faster loading only a few 2-3K .kix files, instead of loading kix32.exe AND a few 2-3K .kix files.

Many pros and cons to either method of running it.

Top
#47029 - 2003-10-20 01:45 AM Re: DEL command not deleting read-only files
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
My method is still the best. [Wink] IMHO YMMV
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#47030 - 2003-10-20 01:57 AM Re: DEL command not deleting read-only files
Everyone Offline
Getting the hang of it

Registered: 2003-10-19
Posts: 81
Loc: Beale Air Force Base, CA
Looks that way so far. [Wink]
Top
Page 1 of 2 12>


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

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 1.687 seconds in which 1.55 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