0

I'm creating a script to back up, sweep, and validate a database. There will be multiple tasks scheduled to do this management job.

Q1: Can I use dashes, underscores, periods, and other punctuation to name my tasks (SCHTASKS /TN paramerter)?

Q2: What about task name length? Is there a limit to a certain number of chars?

I want to do something like this:

SchTasks /TN Ibak1.Make_Copy /TR "%5Ibak1.bat %1 %2 %3 %4 "           /ST %6 /IT /SC DAILY           
SchTasks /TN Ibak2.Firebird  /TR "%5Ibak2.bat %1 %2 "                 /ST %7 /IT /SC DAILY           
SchTasks /TN Ibak3.Copy_Log  /TR "%5Ibak3.bat ibaklog.txt %2 %3 %4 "  /ST %8 /IT /SC DAILY           
        
 
0

2 Answers 2

0

Amending @Jonathan's answer

I'm programmatically creating the task in C# so may be C# constraint

Answer1: will not accept the colon character ( : )

Answer2: may accept more but at least 122 characters

0

Okay this was easy to answer: from a windows command prompt run SCHTASKS It will show you a list of scheduled tasks. Windows schedules a whole bunch. Here's some from my computer:

Folder: \Microsoft\Windows\.NET Framework
TaskName                                 Next Run Time          Status
======================================== ====================== ===============
.NET Framework NGEN v4.0.30319           N/A                    Ready
.NET Framework NGEN v4.0.30319 64        N/A                    Ready
.NET Framework NGEN v4.0.30319 64 Critic N/A                    Disabled
.NET Framework NGEN v4.0.30319 Critical  N/A                    Disabled
HPEA3JOBS                                N/A                    Ready
LenovoUtility Startup                    N/A                    Ready
OneDrive Per-Machine Standalone Update T 2022-09-28 2:11:45 PM  Ready
OneDrive Reporting Task-S-4-5-25-33445   2022-09-28 2:08:40 PM  Ready

Answer1: Apparently task names can have all sorts of characters in them including spaces.

Answer2: If the heading underline is any indication the max task name length is at least 40 chars.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .