[Win32utils-devel] win32-taskscheduler andTaskScheduler#account_information

Park Heesob phasis at gmail.com
Sat Jan 12 22:46:04 EST 2008


Hi,
----- Original Message ----- 
From: "Daniel Berger" <djberg96 at gmail.com>
To: "win32utils-devel" <win32utils-devel at rubyforge.org>
Sent: Sunday, January 13, 2008 4:36 AM
Subject: [Win32utils-devel] win32-taskscheduler andTaskScheduler#account_information


> Hi,
> 
> This library has needed some work for a while, so I'm finally getting 
> around to it. I've made some changes and updates in CVS, so grab the 
> latest source to test the issue below.
> 
> The first issue I'd like to tackle is why the 
> TaskScheduler#account_information (GetAccountInformation) method fails 
> if there's no user associated with a given task.
> 
> The docs say it should return one of four values:
> 
> http://msdn2.microsoft.com/en-us/library/aa381228.aspx
> 
> In practice I would simply expect an empty string. But what I'm seeing 
> is that it returns some bogus error number.
> 
I think the document is wrong.
GetAccountInformation returns SCHED_E_ACCOUNT_INFORMATION_NOT_SET(0x8004130FL) 
when the account information is not set or not proper name/password. 

trigger = {
   "start_year"  => 2009,
   "start_month"  => 4,
   "start_day"    => 11,
   "start_hour" => 7,
   "start_minute" => 14,
   "trigger_type" => TaskScheduler::DAILY,
   "type"   => { "days_interval" => 1 }
  }
ts = TaskScheduler.new("foo",trigger) 
ts.save 

#Get account information fails with 0x8004130FL: 

ts = TaskScheduler.new()  
ts.activate("foo") 
begin 
  print ts.account_information
rescue
  print "An error occurred: ",$!, "\n"
end

#After setting account information like this:

ts = TaskScheduler.new()  
ts.activate("foo") 
ts.set_account_information("account","passwd") 
ts.save  

#Get account information works fine: 

ts = TaskScheduler.new()  
ts.activate("foo") 
begin 
  print ts.account_information
rescue
  print "An error occurred: ",$!, "\n"
end


> Any ideas?
> 
> Thanks,
> 
> Dan
>
 
Regards,

Park Heesob


More information about the win32utils-devel mailing list