#168057 - 2006-09-19 12:02 PM
BUG? DEL command deletes more than its told to do.
|
ArildS
Lurker
Registered: 2006-09-07
Posts: 3
Loc: Norway/Oslo
|
Hi
Discovered someting yesterday with the DEL command in V4,52 of Kixtart.
The appended script is part of an old script that starts Lotus Notes depending on the status of the ~notes.lck file. The ~notes.lck file sometimes remain after a crash and to prevent the necessity of starting Notes twice to get rid of it I try to delete it before running Notes. With Kixtart V4.22 this worked great, but when I upgraded to Kixtart V4.52 the script started deleting other files in the 'h:\notes\data' folder seemingly at random. Sometimes it even deleted all the files in the f:\admin\cmdfiles folder on the Citrix terminal server.
IF INSTR("%CLIENTNAME%","VSw")>0 DEL H:\NOTES\DATA\~notes.lck /f /c /h IF EXIST ("H:\NOTES\DATA\~notes.lck") MESSAGEBOX("Notes is already running from your Hdisk. Trying from W:", "Notes already running!" ,48,10) DEL W:\NOTES\DATA\~notes.lck /f /c /h IF EXIST ("W:\NOTES\DATA\~notes.lck") $Valg1 = MESSAGEBOX("You have 2 hanging Notes sessions. Press 'Retry' to try from W: anyway, or press 'Cancel' and call 199 for assistance!!!", "Notes already running!" ,37,15) IF $Valg1 = -1 SHELL "F:\Admin\CmdFiles\FraW.cmd" ENDIF IF $Valg1 = 2 Goto Ring199 ENDIF IF $Valg1 = 4 SHELL "F:\Admin\CmdFiles\FraW.cmd" ENDIF Goto end ENDIF SHELL "F:\Admin\CmdFiles\FraW.cmd" GOTO END ENDIF SHELL "F:\Admin\CmdFiles\FraH.cmd" Goto END
ENDIF
I spesifically want to delete only the 'H:\NOTES\DATA\~notes.lck' file in this script. Why does the DEL command delete more files? Bug or am I totally insane and inept...
|
|
Top
|
|
|
|
#168058 - 2006-09-19 12:43 PM
Re: BUG? DEL command deletes more than its told to do.
|
RemcovC
Starting to like KiXtart
   
Registered: 2006-09-13
Posts: 174
Loc: Holland
|
I have no means to test things now, but I think the problem is in de ~ in your DEL command line, ~ is in Kix a logical NOT.
You could try to use quotes like this Code:
DEL 'H:\NOTES\DATA\~notes.lck' /f /c /h
|
|
Top
|
|
|
|
#168060 - 2006-09-19 02:17 PM
Re: BUG? DEL command deletes more than its told to do.
|
Les
KiX Master
   
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
Failing to delimit strings with quotes is just bad coding, plain and simple.
KiX 4.50 added ~
Quote:
Release notes for KiXtart 2010 (version 4.50)
New functionality/enhancements:
1) Pre-tokenizing. Pre-tokenizing a script stores the script in a binary format that is smaller and has a faster loadtime. Pre-tokenized script have the extension ".KX".
To pre-tokenize a script, use the "/t" command line option:
KIX32 <yourscript.kix> /t
2) IMPORTANT CHANGE: Previous versions of KiXtart automatically appended the extensions".KIX" and ".SCR" to filenames specified without an extension. As of this build, KiXtart itself no longer uses the ".SCR" extension. Instead, KiXtart always tries for the ".KX" extension first, followed by the ".KIX" extension.
3) INCLUDE command.
The new INCLUDE command enables you to include code in separate script-files. If a script is pre-tokenized, any included scripts are merged into the resulting ".KX" file.
INCLUDE takes a single argument: a string containing the filename of the script to include.
Note that this string can not contain macros or variables.
4) Debug mode now uses the actual console size.
5) EnumIPInfo now has a 're-read' option.
To cause EnumIpInfo to re-read the IP-information, specify a 3rd parameter with a value of 1 (e.g.: EnumIPInfo(0,1,1) ).
6) FormatNumber was fixed to deal with numbers with multiple zeroes after the decimal point.
7) Added NoMacrosInStrings option. If this option is ON, macros inside strings are not resolved.
8) Added an operator for XOR operations: ^.
9) Added an operator for binary NOT operations: ~.
10) Added support for block comments. A block comment is a sequence of characters beginning with a forward slash/asterisk combination (/*) A comment can include any combination of characters, including newline characters, but excluding the "end comment" delimiter (*/). Comments can occupy more than one line but cannot be nested.
11) Enhanced Split() to support the case-sensitivity option.
12) Added support for new Windows versions to @PRODUCTTYPE.
13) Added a new macro indicating if the current session is to a terminal server: @TSSESSION.
14) Added a new macro indicating if the current process runs on the WOW64 subsystem: @ONWOW64.
15) Enhanced commandline processing so you can declare variables and still have KiXtart automatically run a default script (eg: "KIXTART.KX").
Please report any issues with this release on one of the KiXtart discussion forums on the Internet:
http://www.kixtart.org http://www.scriptlogic.com/kixtart
If your issue can not be resolved on the forums, please email full details on the problem, configuration and script(s) involved to kixtart2001@hotmail.com.
Note that KiXtart is provided to you as CareWare. Please see the manual for full details on the KiXtart CareWare distribution policy.
|
|
Top
|
|
|
|
#168062 - 2006-09-19 03:25 PM
Re: BUG? DEL command deletes more than its told to do.
|
RemcovC
Starting to like KiXtart
   
Registered: 2006-09-13
Posts: 174
Loc: Holland
|
I think so, thats why i suggested to put the filename in quotes
|
|
Top
|
|
|
|
#168064 - 2006-09-19 03:45 PM
Re: BUG? DEL command deletes more than its told to do.
|
RemcovC
Starting to like KiXtart
   
Registered: 2006-09-13
Posts: 174
Loc: Holland
|

But I'm still waiting for a response from ArildS, if the problem is solved or not.
|
|
Top
|
|
|
|
#168066 - 2006-09-19 04:51 PM
Re: BUG? DEL command deletes more than its told to do.
|
RemcovC
Starting to like KiXtart
   
Registered: 2006-09-13
Posts: 174
Loc: Holland
|
Off topic: And this design flaw is widely taken advantage of in Kixgolf
|
|
Top
|
|
|
|
#168068 - 2006-09-19 05:06 PM
Re: BUG? DEL command deletes more than its told to do.
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
that's why I said design flaw 
I could have said bug, as it qualifies for that too.
Edited by Jooel (2006-09-19 05:07 PM)
|
|
Top
|
|
|
|
#168069 - 2006-09-28 12:03 AM
Re: BUG? DEL command deletes more than its told to do.
|
ArildS
Lurker
Registered: 2006-09-07
Posts: 3
Loc: Norway/Oslo
|
You got it. The quotes solved the problem. The ~ sign obviously caused the problem when no quotes was used.
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 962 anonymous users online.
|
|
|