Please Read: Significant Update Planned, Migrating Forum Software This Month

See more
See less

NTBackup Batch File Error

  • Filter
  • Time
  • Show
Clear All
new posts

  • NTBackup Batch File Error

    Hello Colleagues

    I was trying to set up a generic ntbackup batch file that would backup the document and settings of certain user machines to a share . Operating System used is XP Pro. However I ran into trouble with the script when it refuses to work. A look in the event viewer shows the following :-

    Type: Error
    Date: 07/02/2008
    Time: 08:56:53
    Event: 8017
    Source: NTBackup
    Category: None
    User: N/A
    Computer: WIL5H85Y0J
    NTBackup error: 'Invalid command line parameter '"@c:\Exchange\2008'.'

    Type: Error
    Date: 07/02/2008
    Time: 08:56:52
    Event: 8017
    Source: NTBackup
    Category: None
    User: N/A
    Computer: WIL5H85Y0J
    NTBackup error: 'Expecting more command line parameters.'

    The script used is as follows:-

    set USERPROFILE1 = "\\%COMPUTERNAME%\C$\Documents and Settings\%USERNAME%\My Documents"
    net use W: \\WILWCAPW3463480\%COMPUTERNAME% /USER:WILWCAPW3463480\%COMPUTERNAME% wilsonuk
    ntbackup backup /j "WEEKLY BACKUP" %USERPROFILE1% /f W:\%COMPUTERNAME%.bkf /um
    ntbackup backup /j "EXCHANGE BACKUP" "@c:\Exchange\2008" /f W:\%COMPUTERNAME%-Exchange.bkf /um
    net use W: /delete

    Any ideas what I might be doing wrong ? Have I ran into an undocumented issue with NTBackup ?



  • #2
    Re: NTBackup Batch File Error

    Hi caomhim.

    Your syntax for ntbackup.exe is incorrect.
    -First thing is both of your backup commands don't have a .bks file specified.
    -The "@" symbol needs to proceed the backup set.
    -I've never tried it any other way but the switches should follow the backup set, not proceed it. The /j switch can be safely moved to the end of the line.
    -The /um switch only works with 2000. Since you have XP Pro you should take it out. Plus, since you're backing up to a file, you don't need that switch anyways.

    Below I give the example of using backup sets that are stored in C:\BackupSets
    ntbackup backup "@C:\BackupSets\weekly.bks" /f W:\%COMPUTERNAME%.bkf /j "WEEKLY BACKUP" 
    ntbackup backup "@C:\BackupSets\Exchange.bks" /f W:\%COMPUTERNAME%-Exchange.bkf /j "EXCHANGE BACKUP"
    Since you're trying to backup the documents of certain users maybe just copying the contents of their documents folder to the share and then running the backup job would be a better solution.

    Network Consultant/Engineer
    Baltimore - Washington area and beyond