Authorization problem I think

nnCron and nnCron LITE discussion

Authorization problem I think

Postby Frank » Tue, 31 May 2016, 11:32

I am running Windows 7 Ultimate.
I have a small scrip in nnCron.tab as follows:

Code: Select all
#( FF_Frank
WatchLogon: "Frank"
Action:
PAUSE: 1000
ShowNormal NormalPriority
StartIn: "D:\Dropbox\Copy
START-APP: D:\DropBox\Copy\Firefox_Tbird.bat F
)#


My batch file contains a 'start' application with C:\Windows\System32\StripMyRights.exe.
When the batch execution reaches this 'start' line I get a windows error saying that Windows cannot find 'C:\Windows\System32\StripMyRights.exe'.
The thing is windows cannot find this file only when the batch is run from nnCron. When I run the batch file from a shortcut to the batch file, it works fine.
Any ideas?
Thanks
Last edited by VoidVolker on Thu, 09 Jun 2016, 23:04, edited 1 time in total.
Reason: Use bb-tag 'code' for source code
Frank
 
Posts: 30
Joined: Sun, 02 Apr 2006, 09:18

Re: Authorization problem I think

Postby semko » Tue, 31 May 2016, 14:58

You are running nncron as a service, right? If so, read the help: Working with nncron > Tasks > Authorization.
Add a User: line to your task.
Btw. there is a closing double quote missing in your StartIn line.
semko
 
Posts: 46
Joined: Sat, 08 Oct 2005, 17:42
Location: Germany

Re: Authorization problem I think

Postby Frank » Tue, 31 May 2016, 15:10

Thank you for that.
Yes, I am running nnCron as a service.
I tried it and although I don't get an error, the batch file does not run.
Also tried AsLoggedUser. This gives me an error - Can't get logged user token.
Frank
 
Posts: 30
Joined: Sun, 02 Apr 2006, 09:18

Re: Authorization problem I think

Postby semko » Tue, 31 May 2016, 15:36

OK. Create a new task in nncron.
Check Run as User.
The Name filed should show the name of the user that is currently logged in.
Enter the password of that user.
The Domain field should show the name of your computer.
Login type should show Interactive.
Click Test logon. If the popup shows User name, password ... are correct, open the Advanced tab.
Copy the User: line and add it to your original task.

No need to save the intermediate task you just created.
Hope that helps.
semko
 
Posts: 46
Joined: Sat, 08 Oct 2005, 17:42
Location: Germany

Re: Authorization problem I think

Postby Frank » Wed, 01 Jun 2016, 01:58

Yes, I just tried to go through your procedure.
The procedure is fine, I was able to create a task that way and recreated a task for running my batch file.
The task is created without error. I can execute the new task without error - but, unfortunately the batch file does not start.
I thought that maybe because it has a WatchLogon. Since I execute it manually, it might be waiting for a logon. I removed that line, but still the same, the batch file does not start.
Frank
 
Posts: 30
Joined: Sun, 02 Apr 2006, 09:18

Re: Authorization problem I think

Postby semko » Wed, 01 Jun 2016, 13:52

What's in the nncron log for that task?
Does the FF_Frank WatchLogon task get startet when you log in?
Does it start the Batch?
What is the start result code?
semko
 
Posts: 46
Joined: Sat, 08 Oct 2005, 17:42
Location: Germany

Re: Authorization problem I think

Postby Frank » Thu, 02 Jun 2016, 00:32

The log extract upon booting is as follows:

Code: Select all
07:13:55 3868 Start nnCron
07:14:00 3868 Load crontab
07:14:00 3868 D:\System_Data\nncron.tab
07:14:00 5844 Console server is started.
07:14:00 6000 TASK: Network_Temp
07:14:00 6004 TASK: Delete_WinTemp
07:14:00 6008 TASK: Reminders
07:14:00 6008 Start: D:\Dropbox\MyProgs\Reminder\Reminder.exe
07:14:00 5992 TASK: FF_Frank
07:14:00 5992 Start: D:\Dropbox\Copy\Firefox_Tbird.bat F
07:14:01 6008 Start result: 0
07:14:01 5992 Start result: 1314
07:14:10 6000 Start: D:\Dropbox\MyProgs\Network\NetworkIndicator.exe
07:14:11 6000 Start result: 0
07:14:21 6000 Start: D:\Frank\Program Files\SpeedFan\speedfan.exe
07:14:21 6000 Start result: 0


There is a 1314 error for that task. This is the error received if I run the task manually as well.

EDIT: The batch file runs during the boot but does not run launching the task afterwards.
I entered the line:
Code: Select all
NET SESSION >nul 2>&1

into the batch file to see what privileges the batch file is running under.
The errorlevel returned while booting is a 2, which indicates a standard 'user' privilege.
I auto boot the computer into windows 7 ultimate as an admin user. So, the standard 'user' privilege is coming from nnCron.
Last edited by VoidVolker on Thu, 09 Jun 2016, 23:04, edited 1 time in total.
Reason: Use bb-tag 'code' for source code
Frank
 
Posts: 30
Joined: Sun, 02 Apr 2006, 09:18

Re: Authorization problem I think

Postby semko » Thu, 02 Jun 2016, 09:40

According to the log the batch gets startet.
Error 1314 is 'A required privilege is not held by the client'. So there must be a command in your batch that requires full admin privileges. Could you just for a test disable UAC and see what happens?
semko
 
Posts: 46
Joined: Sat, 08 Oct 2005, 17:42
Location: Germany

Re: Authorization problem I think

Postby Frank » Thu, 02 Jun 2016, 09:47

Yes, it is and has always been disabled.
Where did you find the meaning of the start code 1314?

Edit:
I have another machine that has a standard user. This user can run the batch file without any problems.
Of course it needs access to C:\Windows\System32\StripMyRights.exe for executing and appears to have it.
Frank
 
Posts: 30
Joined: Sun, 02 Apr 2006, 09:18

Re: Authorization problem I think

Postby semko » Thu, 02 Jun 2016, 12:03

For the error codes try this download link:
http://www.nncron.ru/download/spf_err.rar

You could try to run your batch with the Windows scheduler instead. Create a new job and use user login as a trigger and be shure to check 'run with full privileges'.
semko
 
Posts: 46
Joined: Sat, 08 Oct 2005, 17:42
Location: Germany

Re: Authorization problem I think

Postby Frank » Fri, 03 Jun 2016, 01:09

Thank you for the link.
I have used windows task scheduler before and works fine except it can only be delayed in increments of 1 minute. I would like to execute the applications I have in nnCron at increments of 10 - 20 seconds.
With all the investigations and following your recommendation, I think I found a solution. Since StripMyRights.exe is a single file portable application, I moved it onto drive D: that has permissions for everyone to use. nnCron, with my original script works fine.

I have read that nnCron in windows 7 64bit should not be run as a service. I think the only way to change my installation is to uninstall and reinstall without the service. Is this correct?
Thanks
Frank
 
Posts: 30
Joined: Sun, 02 Apr 2006, 09:18

Re: Authorization problem I think

Postby VoidVolker » Thu, 09 Jun 2016, 22:58

Frank wrote:I have read that nnCron in windows 7 64bit should not be run as a service. I think the only way to change my installation is to uninstall and reinstall without the service. Is this correct?Thanks

Yes. For Windows from Vista and above - run nncron as application.
95% вопросов уже обсуждались на форуме или ответы на них есть в мануале.        nnCron 1.93 b15.exe
Как правильно задавать вопросы.
User avatar
VoidVolker
Site Admin
 
Posts: 2898
Joined: Tue, 25 Apr 2006, 17:56

Re: Authorization problem I think

Postby Frank » Fri, 10 Jun 2016, 00:38

In digging around I noticed that the Start nnCron batch file automatically starts my nnCron as an application and I have no nnCron service running.
So, that part is ok. I have also updated to V1.93 b15. I find this version in the forum in a post.
Where can the latest version of nnCron be found on the website?
Thanks
Frank
 
Posts: 30
Joined: Sun, 02 Apr 2006, 09:18

Re: Authorization problem I think

Postby VoidVolker » Fri, 10 Jun 2016, 09:35

Frank wrote:Where can the latest version of nnCron be found on the website?

It is not yet on website - because it still in beta status. Latest link is always in my forum signature below.
95% вопросов уже обсуждались на форуме или ответы на них есть в мануале.        nnCron 1.93 b15.exe
Как правильно задавать вопросы.
User avatar
VoidVolker
Site Admin
 
Posts: 2898
Joined: Tue, 25 Apr 2006, 17:56


Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 1 guest