Page 1 of 1 1
Topic Options
#6705 - 2001-02-06 02:46 PM Kix and AT
Anonymous
Unregistered


Hello again.

I am trying to set up a kix script to run daily with the NT AT scheduler. I have a fully working kix script, and a ftp.cmd file that runs the script. If I double click the cmd file the script runs, and the files get transferred. However when I put the cmd file to be run by the AT service, it says it can't find the files. I know that the AT scheduler works OK as I can set it to open an instance of notepad. The beginning of my script calls a dir command to get the list of files. I have created a script file that runs the dir command, and puts a note on the screen as to whether it has found files or not. Again if I run this command by double clicking the icon it works OK, but if I set it up on the scheduler it says it can't find any files.

At scheduler is set with
AT 9:45 d:\scripts\neil.cmd

Relevant code is below.
neil.cmd file to run kix script

d:
cd \
cd ftp2btc
kix32 neil.kix
pause

script to list files

Break on
cls
$cr=chr(13)+chr(10) ;Code to enter for carriage return (DO NOT ALTER)


$temp=c:\temp ;Temp folder
$list=c:\temp\files.nsf ;List of files to be transferred
$source=\\source\BVPDATA\MF_DATA


? " -Creating list of Files to be transferred"

shell "%comspec% /c dir /o:d /b " + $source + "\BO*.RDY > " + $list


;to change type of file change BO*.RDY on above line


shell "%comspec% /c type " + $list + " | find /c " +chr(34) + "rdy" +chr(34) +" >nul"

if @error=0

? " -Files found"
exit
else
cls
? " -There are no files to be transferred in "+$source
exit
endif


Top
#6706 - 2001-02-06 03:10 PM Re: Kix and AT
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Since you say that code runs great when you manually start it, i will say that this is not a code problem.

It sounds like it is a permission problem.

Does this NT computer have IE4 or greater installed? If so, the "AT Service" was upgraded to "Scheduled Tasks".

By default any task that you schedule with AT runs under the "System Account", and by design, the "System Account" can not access any network resources, this would include your FTP.

Under the older AT service, you would fix that by just running the AT service under a username/password instead of using the "System Account".

But the newer "Scheduled Tasks" will ONLY run under the system account.

The new "Scheduled Tasks", when accessed using the GUI interface, gives you the RUNAS option so you can specify what username/password you want the task to run under. When you schedule a task using the AT command line tool, the job will run under he default "System Account".

I have been unable to find a command line tool that is equal to the GUI interface

To fix this your choices are,

1. Use thE GUI tool to schedule your jobs.
2. Use the SU command in the cmd file to start the kix script under a username/password that has network access rights.

Bryce

[This message has been edited by Bryce (edited 06 February 2001).]

Top
#6707 - 2001-02-06 03:35 PM Re: Kix and AT
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Hi Cris,

I found that you HAVE to use quotes around the command, so the command should look like:

AT 9:45 "D:\scripts\neil.cmd"

I also created a service account that has the correct share & NTFS-rights and started the schedule service with that account.

Try your script by logging on to the machine with the created account and then run the command. If this works it should work with the AT-command.

------------------
Greetz,

Roger the Young
------------------------
The code is out there...
------------------------

_________________________
The Code is out there

Top
Page 1 of 1 1


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

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

Generated in 0.059 seconds in which 0.033 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