windows-server-2003 – 有没有办法将计划任务从Windows 2003(.job)导入到Windows 2008(.xml)?

前端之家收集整理的这篇文章主要介绍了windows-server-2003 – 有没有办法将计划任务从Windows 2003(.job)导入到Windows 2008(.xml)?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一些工作要从旧的生产服务器( Windows 2003服务器标准)移动到新机器(Windows 2008服务器标准),但新服务器无法读取旧的.job格式,导入向导只能从.xml作业文件(相同版本).显然,我不想手工重建所有工作,但找不到使工艺变得更容易的工具.我不相信微软的这种工具,我以前的经历一直很糟糕(DTS – > SSIS).有任何想法吗?

提前致谢.

看起来他们在这里讨论问题: http://social.technet.microsoft.com/Forums/en-US/itprovistamigration/thread/76b6276b-49f2-41e2-b4ea-f537e0eb88a8

似乎没有目前批准的方法来做到这一点.

但该论坛中的一位用户发布了这样的信息

如果从vista / 2008服务器上运行schtasks,可以将xp / 2003 schtasks导出到xml. schtasks / query / s xpmachine / tn taskname / XML> taskname.xml然后你可以导入它.不完美但可以节省时间.我使用/ fo table打开任务导出excel删除不需要的列并创建批处理文件以转储xmls然后/ create / xml xmlfile.xml将xmls导入新服务器.希望这可以帮助.

所以它似乎有可能,但它需要一些jiggery pokery.

我自己试了一下,但继续从Win2008获取访问被拒绝的错误.即使我是具有所有权限的网络管理员.也许别人可以尝试一下?

编辑 – 解决方案:

Where you got your job files was probably c:\windows\tasks,however under Vista there is a new place the xml files exist. (Under c:\windows\system32\tasks)
Try looking there on your old machine if possible.

HOWEVER,there is a way if you can’t get to the original machine easily.

  • You will need 2 files off an XP machine (Schtasks.exe and Schedsvc.dll) they are both in the Windows\System32 folder,copy them to USB and thats all you need from XP.
  • Now on your Vista machine.
    Put them in their own directory on your vista machine (lets say you make a directory called c:\sch and put those 2 files in there)
    DO NOT overwrite the vista ones in c:\windows\system32.
  • Rename your job files Test1.job,Test2.job,Test3.job,Test4.job and copy them into c:\windows\tasks
  • Open up a command prompt (Start Programs,Accessories,right click on Command Prompt and select run as administrator)
  • Now to touch over the new .job files to get vistas scheduler to take on the parameters.
  • In your command prompt
    type in cd c:\sch then enter (for our example)
  • Now for each job type in
    schtasks /change /TN “Test1” /RU Terry /RP Terry
    (Changing the Test1 to Test2,Test3,Test4 for our example)
    The /RP and /RU values will have to change,thats a username and password (RP being password,RU Being User)
  • You should receive the message
    SUCCESS: The parameters of scheduled task “Test1” have been changed.
    for each job.

When done close your command prompt.
From there Windows scheduler now knows about these,and you can use the windows Gui to update their names,and who they run as.

我亲自试过这个,是的确有效.编写脚本只需要花费一点力气.您只需将xp文件保留在vista机器上即可.然后,您也可以通过脚本将它们导出为XML.

链接From experts exchange

猜你在找的Windows相关文章