![]() |
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Hi,
I need to add entries to the task scheduler, but I only want to do it if I'm installing on a server machine. I already know how to add to the task scheduler. What I need to know is how to check if I'm running on one of the windows servers... Thanks, Edgard |
|
#2
|
|||
|
|||
|
Edgard,
What you can try is the "Get System Information (Windows Product Type)" script function. This lets you retrieve additional information about the Windows system. It can be one of the following values: $VER_NT_WORKSTATION$—The system is running Windows Workstation. $VER_NT_DOMAIN_CONTROLLER$—The system is a domain controller. $VER_NT_SERVER$—The system is a server. Does this help? Friedrich |
|
#3
|
|||
|
|||
|
Hi,
Thanks for the reply. It works fine in that the dialog only displays when running on a server. However the problem is that the task is not added on the server :-) I re-read the documentation for "Add Scheduled Task" and surely enought it doesn't mention servers..... Is it possible to add scheduled tasks to a server? Thanks again, Edgard |
|
#4
|
|||
|
|||
|
Edgard,
Yes, should work fine on Windows Server <g> http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx Just tested it on Server 2008 R2 and it created the "My Taskname" without any problem. HTH, Friedrich |
|
#5
|
|||
|
|||
|
Hi again,
Ok. It is working now partially. I have a couple of requirements which might not be that easy to achieve.... 1) I need to fill the "Location" field (which sets the working folder). The "Add Scheduled Task" function doesn't have an entry for this. In my case this is important because the executable I want to run gathers information from other files on the startup folder (i.e. the folder where the executable is located at). If there is no startup folder, it looks for files on a windows folder. 2) The other problem I have is that I need to run the task at 10,12,2PM,4PM,6PM,8PM,9PM,10PM,11PM,12AM,1AM. Can this be done? I tried adding the task repeatedly, each time with the next hour, but after the first task is added, all the next fail. Sorry for all the trouble, Edgard |
|
#6
|
|||
|
|||
|
Edgard,
1) In the upcoming V7.7, you can set the "Working Directory" (see attached screenshot). I don't have a good answer to 2). In V7.7 there is a "Repeat Task (Minutes)" option but as I understand it, your "repeat task" is not constant. BTW, the task name has to be unique! If you add the task repeatedly and it fails then you tried to add the same task (name) twice. Windows does not allow this. HTH, Friedrich |
|
#7
|
|||
|
|||
|
Quote:
![]() Quote:
Thanks! Edgard |
|
#8
|
|||
|
|||
|
It's available now
![]() Friedrich |
|
#9
|
|||
|
|||
|
Hi Friedrich,
Great news! I already downloaded it, and tested it. I added my task to the Task Scheduler, and compromised by setting the "Repeat Task" to 90 minutes, and the proper startup folder. When the task is added, the setting "For a duration of" gets a 1 day only setting. I went ahead and changed it manually to "Indefinitely". I guess this is something you might want to look at... Thanks, Edgard |
![]() |
| Tags |
| server, task scheduler |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|