3

I have a backup of some .job files (i.e, scheduled tasks) from my old computer. I see that windows 7 does not support job files instead they accept xml files. So, i would like to know if there is a way to convert job files to xml files and import them into windows 7 machine?

Thanks.

4 Answers 4

2

If your machines are not on the same domain or cant otherwise communicate, using the /S switch wont work so you need an alternative. Although the above answer that describes the manual process worked for me as well, I wanted an easier way to do it and came up with this: http://briandunnington.github.io/migrate-scheduled-jobs.html

Essentially, you copy your .job files to c:\windows\tasks, then run the script (providing a username/password) and your jobs are automatically converted - no messing with copying old dlls, creating batch script, renaming things, etc.

1

This process requires that you can get to information on your XP machine, because you will need all of the .job files. But it will take all of your .job files and create the .xml and the associated scheduled tasks. A co-worker came up with the files and general process for me when I upgraded systems and had 260 .job files to transfer and I wrote it up to try to be able to help others in my same position. It's a little long, but it works, and that's all that matters. Hope it helps!

  1. From XP machine, copy the schedsvc.dll and schtasks.exe files from C:\WINDOWS\system32\ onto a USB drive. a. If you can’t find the files on your XP machine, you can check here http://www.whatisdll.com/schedsvc-dll-repair-free-download-windows-78xpvista/ and here http://www.whatisdll.com/schtasks-exe-repair-free-download-windows-78xpvista/ for help.
  2. From XP Machine, go to folder where .job files are stored (most likely C:\Windows\Tasks) and copy all .job files onto USB drive.
  3. Create a folder on Vista/Win 7 Machine on your desk top for this process. Ex. C:\Users\username\Desktop\SchedTasks
  4. Move .job files, .dll, and .exe files into the new folder on the Vista/Win 7 machine.
  5. Open C:\WINDOWS\Tasks and copy all of the .job files into that folder as well.
  6. Open a new notepad document and enter the following, without the quotation marks “dir /B >> dir.txt”
  7. Save the text document the folder created on the desktop with the file name GetFiles
  8. Change the .txt extension on the file to .bat and click Yes on the pop-up that asks if you are sure you want to change the extension.
  9. Check to make sure that in the new folder you created on the desktop of the Vista/Win 7 machine you now have the following files: a. All of the .job files from your XP machine b. GetFiles.bat c. schedsvc.dll d. schtasks.exe
  10. Double click on the GetFiles.bat.
  11. A new file will appear called dir.txt Note --> It might appear as the very first file in the folder .
  12. Open the dir.txt file. It will contain all of the names of the files in the folder.
  13. Remove the file names for GetFiles.bat, schdsvc.dll, and schtasks.exe so you are left with only the .job file names.
  14. Open a new Excel spreadsheet.
  15. Type the following in the noted columns: a. Column A - schtasks b. Column B – /change c. Column C – /TN d. Column E – /RU e. Column F – your username f. Column G – /RP g. Column H – your password, if you have one
  16. Copy the file names that are in the dir.txt file and paste them into Column D. (keep in mind that 'spaces' are not allowed in DOS, so replace them for '_ underscores'. You need to change the job names as well)
  17. Copy down the other columns filled in on step 13 to match the number of file names listed.
  18. Press CTRL+H. In “Find What” enter .job, leave “Replace With” blank, and click “Replace All”.
  19. Click on File --> Save As and save the spreadsheet to a Text (MS-DOS) (*.txt) file to the folder you created with whatever file name you’d like Ex: Taskcmd. Click OK and Yes on the two pop-ups that will ask if you are sure you want to save the file to that format.
  20. Close the spreadsheet (you can save it if you’d like, but it’s not used again), but it will have to be closed for the next steps.
  21. Open the .txt file just created and make sure that none of the file names have the .job after them. Remove them if so (you can use the same CTRL+H method). Close the file when you are certain that all of the file names do not have the .job (remember to save the file if you had to make any changes).
  22. Change the .txt extension to a .bat and click Yes when it asks if you are sure.
  23. Click on the Start Menu and type cmd into the search bar, open the Command Prompt.
  24. Type the path to the file in the folder on your desktop. Using the example above, this would be (without the quotes) “ cd C:\Users\username\Desktop\SchedTasks” and press enter.
  25. In the new prompt type the name of the file created in step 18, including the extension. Using the example above, this would be (without the quotes) “Taskcmd.bat” and press enter.
  26. You should now see all of the files being processed with a note of “SUCCESS” after each one.
  27. Once the batch has completed, you will be able to open the Task Scheduler, click on Task Scheduler Library, and see all of your new tasks, ready to run, in center pane.
1
  • FOR /R . %F in (*.job) do schtasks /change /TN "%~nF" /ru (username) /rp (password) Will allow you to run for each job in the folder without Excel etc.
    – Jeff F.
    May 1, 2017 at 15:39
1

Building off the answers and comments...

You don't need to download any software, or go through a convoluted process of commands and spreadsheets.

Here's a batch file which does this properly and accounts for spaces in the task names.

The only things you need to do are copy the .job files from the XP machine to the Vista - Windows 10 machine, copy schtasks.exe from the XP machine to the new machine, and change user and password in the below batch file.

The batch file itself explains it all.

@echo off
setlocal
echo 1) Copy the .job files from your XP machine to c:\windows\tasks on the new machine.
echo .
echo 2) Copy schtasks.exe from c:\windows\system32 on your XP machine and put it in the same folder as this batch file on the machine running Vista - Windows 10.
echo.
echo 3) Change user below to the user that will own / run the tasks on the new machine.
echo .
echo 4) Change password to the password of that user.
echo .
echo 5) Run this batch file.
pause
if not exist schtasks.exe (
    echo You don't have schtasks.exe in the same folder as this batch file.
    echo Copy schtasks.exe from c:\windows\system32 on your XP machine and put it in the same folder as this batch file and 
    echo try again.
    goto end
)
rem change user as instructed above
set tmpuser=user

rem change pass as instructed above
set tmppass=password
echo You should now see every job getting imported into the new OS.
for %%a in ("c:\windows\tasks\*.job") do schtasks.exe /change /TN "%%~na" /RU %tmpuser% /RP %tmppass%
echo Done! Note: Do NOT delete the job files. Windows apparently still needs them.
:end
endlocal
0

If you still have access to a PC with XP on it, you can import the .JOB files (if they're not already present in Task Scheduler) and try the following command from an elevated command prompt in Win7:

schtasks /query /s remote_computer_name /u remote_user_name /p remote_password /xml > output_file.xml

If no physical XP machine is available perhaps a VM might also work, but I'm not entirely sure.

Sources: 1, 2

You must log in to answer this question.

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