Page 1 of 2 12>
Topic Options
#118079 - 2004-04-16 09:36 AM Logfile?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
How can I do a logfile?
I've test with WriteLine and RedirectOuput but it dosn't work

Top
#118080 - 2004-04-16 09:56 AM Re: Logfile?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
hmmm,

first of all Welcome!
We could help you if you show us what you got so far
_________________________



Top
#118081 - 2004-04-16 10:04 AM Re: Logfile?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
Okay i've tried this:
Shell 'echo Folgende Datei wurde Koventiert und ins Archiv verschoben: $FileNameXLS >> "C:\KiX\Archiv\log.txt"'

But, it doesn't work

I will be soon in Stuttgart I'm from Bay0rn

Top
#118082 - 2004-04-16 10:19 AM Re: Logfile?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
k,

try this :

Shell '%ComSpec% /c echo Folgende Datei wurde Koventiert und ins Archiv verschoben: $FileNameXLS >> "C:\KiX\Archiv\log.txt"'
_________________________



Top
#118083 - 2004-04-16 10:22 AM Re: Logfile?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
oh kool thank u it works

Another question... the cpu-requierments are at 100% how can i change this?

//EDIT
okay i`ve resolved this problem with Sleep 10


Edited by kixnewbie (2004-04-16 10:24 AM)

Top
#118084 - 2004-04-16 10:30 AM Re: Logfile?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
sleep 10 ?

A bit overdosed, no ?
If it is in a loop sleep 0.001 should do
_________________________



Top
#118085 - 2004-04-16 10:33 AM Re: Logfile?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
Sleep 10 are 10 seconds? so.. 10 seconds are okay i think. Should 0.001 is the same effect like 10 on the cpu-system?
Top
#118086 - 2004-04-16 10:37 AM Re: Logfile?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
yep
_________________________



Top
#118087 - 2004-04-16 10:38 AM Re: Logfile?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
IF @TIME = "10:30:00"
Shell '"C:\kix\pkzip -a %DATE:.=%.zip C:\KiX\Archiv\*.*"
Shell '%ComSpec% /c echo Backup Datei wurde erstellt (%DATE:.=%.zip) >> "C:\KiX\Archiv\log.txt"'
ELSE
GOTO "convert"
ENDIF

If i have this code.. it exits the script automaticaly.. why?
How is it possible to remove File extensions?


Edited by kixnewbie (2004-04-16 10:44 AM)

Top
#118088 - 2004-04-16 10:48 AM Re: Logfile?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
You missed the closing single quote in your first shell statement

(edit: or after a second look you should remove the opening single quote)


Edited by Jochen (2004-04-16 10:51 AM)
_________________________



Top
#118089 - 2004-04-16 10:50 AM Re: Logfile?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Quote:

How is it possible to remove File extensions?





From existing files ?
Easiest way should be a shelled 'rename' (ren)
_________________________



Top
#118090 - 2004-04-16 10:54 AM Re: Logfile?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
I mean this:

Shell '"$ppath\BatchPDF.exe" "$ipath\$FileNameDOC" "$opath\$FileNameDOC.pdf"'

//Edit

Shell '"$kpath\pkzip -a @DATE.zip $apath\*.*"'
Shell '%ComSpec% /c echo Backup Datei wurde erstellt (%DATE:.=%.zip) >> "$apath\log.txt"'

KiX do the second shell but not the first... help me!

This creates a pdf file like this: bla.doc.pdf I would like to remove the .doc

//Edit2

It works now


Edited by kixnewbie (2004-04-16 11:09 AM)

Top
#118091 - 2004-04-16 11:06 AM Re: Logfile?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
if you are 100% sure that there are no more dots in the name you could do this afterwards :

Code:
 shell '%ComSpec% /c rename "$opath\$FileNameDOC.pdf" ' + split($FileNameDoc,'.')[0] + '.pdf'

_________________________



Top
#118092 - 2004-04-16 11:15 AM Re: Logfile?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
It dont work. Befehl oder Dateiname nicht gefunden is the Error. Command or File not found is the error.
Top
#118093 - 2004-04-16 11:22 AM Re: Logfile?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
hmmm, works for me

what is your OS ?
_________________________



Top
#118094 - 2004-04-16 11:29 AM Re: Logfile?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
At the moment WinXP Prof. the script should be run on a Win2k3 Server..
Other question is it possible to check if the script already runs if someone want to start one more time?

Top
#118095 - 2004-04-16 11:48 AM Re: Logfile?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
well, maybe I puzzled the paths ... you should verify these.
The shell statement as such works if the file bla.doc.pdf is resident in the folder I specified.

Instance checking: A bit tricky with board tools, but I think creating a flagfile at the start of script / deleting it at the end should do
(first line in script should be then soemthing like 'If exist( flagfile ) exit 1 endif' )
_________________________



Top
#118096 - 2004-04-16 11:54 AM Re: Logfile?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
Okay I will check the path.

Should I do the check at firstline like this?
If exist( lala.kix ) exit 1 endif

Top
#118097 - 2004-04-16 12:00 PM Re: Logfile?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
nope,

more soemthing like that :

Code:
break on

if exist(@scriptdir + '\flag.file') exit 1 endif
$_ = open(1,@scriptdir + '\flag.file',5)
$_ = close(1)

;Your code here

del @scriptdir + '\flag.file'

_________________________



Top
#118098 - 2004-04-16 12:04 PM Re: Logfile?
kixnewbie Offline
Fresh Scripter

Registered: 2004-04-15
Posts: 38
Resolved!

Now against to this line:
shell '%ComSpec% /c rename "C:\KiX\Out\$FileNameXLS.pdf" ' + split($FileNameXLS,'.')[0] + '.pdf'

should it be
shell '%ComSpec% /c rename "C:\KiX\Out\$FileNameXLS.pdf" ' + split(C:\KiX\Out\$FileNameXLS,'.')[0] + '.pdf'
?

//EDIT
hey Resolved it works now ) too! Thank u i should go home now. More on Monday


Edited by kixnewbie (2004-04-16 12:08 PM)

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 138 anonymous users online.
Newest Members
MaikSimon, kvn317, kixtarts2025, SERoyalty, mytar
17872 Registered Users

Generated in 0.077 seconds in which 0.024 seconds were spent on a total of 14 queries. Zlib compression enabled.

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