Menu

Problems using DriverBackup! in batch files

Help
Maymne
2010-03-29
2012-10-08
1 2 > >> (Page 1 of 2)
  • Maymne

    Maymne - 2010-03-29

    Found a few problems using DriverBackup! in an automated way. One problem is
    that when in a batch file, the last entry is damaged for some reason... For
    example, when I enter the following in a batch file, it fails:
    drvbk MODE="BACKUP" BKPATH="Y:\" BKFILE="%DATE%.bki" BKDEVFMT="%DEVNAME%"
    OPT="H"

    When I give it the following, it works fine:
    drvbk MODE="BACKUP" BKPATH="Y:\" OPT="H" BKFILE="%DATE%.bki"
    BKDEVFMT="%DEVNAME%"

    It isn't just OPT that is getting damaged... if I put BKFILE on the end, it
    gives me the default version instead of failing to generate.

    Which leads to the next issue... If you put %DATE% into the BKFILE, it doesn't
    generate at all. Did generate as %COMPUTER%.bki, didn't generate as
    %COMPUTER%_%DATE%.bki, but in this case I'm wanting to make a driver database,
    so I don't want recovery files, and it's not supposed to generate a backup
    file with the line I'm using, but does so anyways.

    Another issue: You can't give it a network location for your data storage. The
    way I've gotten around this for now is by doing:
    net use Y: \SERVER\SHARE
    my drvbk line
    net use y: /delete /y
    This isn't optimal though compared to actually using the location itself.

    One last issue for now. No matter what I've done with command line, I don't
    seem able to change BKPATHFTM. I wanted it to just save as
    BKPATHFTM="%COMPUTER%" or "%COMPUTER%%DATE%", instead of the standard
    "Drivers %COMPUTER%
    %DATE%" that it defaults to.

    Thanks for the awesome tool. I'm looking forwards to working with this as we
    move towards Hardware Independent Imaging.

     
  • Gvb

    Gvb - 2010-04-13

    Dear maymne

    i'm adding in new release 2.1 support for date and time formatting in order to
    solve this bug reported by a lot of people.
    I tested also saving files in a network computer as \NETPC\Backup and
    DriverBackup! saved files without errors.
    Have you checked network access privileges for DriverBackup! ? Try this way
    and write me about result.

    gvbsource

     
  • Maymne

    Maymne - 2010-04-13

    I believe the issue is when calling it from the command line... It works fine
    saving to a network location from the GUI. Here are some examples. First quote
    is from a command line job to \KECDEV-02\EXPRESS\DRIVERS, second is from a
    command line job to \KECDEV-02\EXPRESS. Both failed to do any drivers. My job
    that maps to the DRIVERS folder and then saves to Q: made 29 folders. The
    failed commands are above each of the entries.

    \kecdev-02\express\drivers\program\drvbk MODE="BACKUP"
    BKPATH="\KECDEV-02\EXPRESS\DRIVERS" OPT="HL" BKFILE="%DATE%.bki"
    BKDEVFMT="%DEVNAME%"

    DriverBackup! 1.0.0.0
    MHEP102-002 Microsoft Windows XP Professional
    Microsoft Framework .NET version: v2.0.50727
    Available memory: 359532 of 1039692 Kbytes.

    Backup started. 32 selected devices.

    Backup completed. Backed up devices: 0 of 32.

    \kecdev-02\express\drivers\program\drvbk MODE="BACKUP"
    BKPATH="\KECDEV-02\EXPRESS" OPT="HL" BKFILE="%DATE%.bki" BKDEVFMT="%DEVNAME%"

    DriverBackup! 1.0.0.0
    MHEP102-002 Microsoft Windows XP Professional
    Microsoft Framework .NET version: v2.0.50727
    Available memory: 325308 of 1039692 Kbytes.

    Backup started. 32 selected devices.

    Backup completed. Backed up devices: 0 of 32.

    The BATCH file I use to capture drivers successfully in command line.

    @call \kecdev-02\express\drivers\program\setwinvervariable >nul
    @if not exist \kecdev-02\express\drivers\%PROCESSOR_ARCHITECTURE%-%_verCmd%
    md \kecdev-02\express\drivers\%PROCESSOR_ARCHITECTURE%-%_verCmd%
    @net use q: \kecdev-02\express\drivers\%PROCESSOR_ARCHITECTURE%-%_verCmd%
    nul
    @start /wait \kecdev-02\express\drivers\program\drvbk MODE="BACKUP"
    BKPATH="Q:\" OPT="H" BKFILE="%DATE%.bki" BKDEVFMT="%DEVNAME%"
    @del q:\??-??-??.bki /q >nul
    @net use q: /delete /y >nul

    This gave me the following:

    dir "\kecdev-02\express\Drivers\x86-5.1.2600\Drivers MHEP102-002_4 13 2010"
    /b
    Broadcom NetXtreme Gigabit Ethernet
    Canon PIXMA iP3000
    HP L1750 LCD Monitor
    HP L1950 LCD Monitor
    Infineon Trusted Platform Module
    Intel(R) Q965 Q963 Express Chipset Family
    Intel(R) 82945G Express Chipset Family
    Intel(R) Active Management Technology - SOL
    Intel(R) ICH9 Family 2 port Serial ATA Storage Controller 2 - 2926
    Intel(R) ICH9 Family PCI Express Root Port 1 - 2940
    Intel(R) ICH9 Family PCI Express Root Port 2 - 2942
    Intel(R) ICH9 Family USB Universal Host Controller - 2934
    Intel(R) ICH9 Family USB Universal Host Controller - 2935
    Intel(R) ICH9 Family USB Universal Host Controller - 2937
    Intel(R) ICH9 Family USB Universal Host Controller - 2938
    Intel(R) ICH9 Family USB Universal Host Controller - 2939
    Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293A
    Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293C
    Intel(R) ICH9DO LPC Interface Controller - 2914
    Intel(R) ICH9R DO DH 4 port Serial ATA Storage Controller 1 - 2920
    Intel(R) Management Engine Interface
    Intel(R) Q35 Express Chipset Family
    Intel(R) Q35 Express Chipset Processor to I O Controller - 29B0
    Intel(R) Q45 Q43 Express Chipset
    Intel(R) Q45 Q43 Express Chipset (1)
    Intel(R) Remote PC Assist Technology - SOL
    Realtek High Definition Audio
    Realtek High Definition Audio (1)
    SoundMAX Integrated Digital HD Audio

     
  • Maymne

    Maymne - 2010-04-13

    Hmm... my quote tags went a bit wonky. I can repost if needed, but hopefully
    it gets the idea across. Thanks for the work... it's making scripting OS
    installs for different hardware versions much closer to being a reality for
    us.

     
  • Adrian Smith

    Adrian Smith - 2010-08-06

    Is there a way to have the software close automatically after running in
    command line mode? I have a script where other actions are following but it
    gets on hold because the software is waiting for an "Enter"
    Thank you

     
  • ebloch

    ebloch - 2010-08-06

    The following in my batch closes OK"

    Start "" /Wait "C:\Users...\Desktop\DrvBK2\DrvBK.exe" MODE="BACKUP"
    BKPATH="C:\Users...\DriverBackup2" BKFILE="Backup %DATE% from i7.bki"
    BKPATHFTM="Drivers i7 %DATE%" OPT="ARLW"
    LOG="C:\Users...\DriverBackup2\Log\Backup.log"

    Note text in BKPATHFTM before %DATE% and inclusion within "s

    What I would like is a setting to limit the number of backup files retained
    and auto-delete the oldest.

     
  • Adrian Smith

    Adrian Smith - 2010-08-06

    I am not using start and wait. What is it for?

     
  • Adrian Smith

    Adrian Smith - 2010-08-06

    I am using Win 7 and the script just sits there waiting for me to press Enter
    - it will run correctly but not close when done

     
  • ebloch

    ebloch - 2010-08-06

    I suggest you go into a CMD window and type "start /?" for its help file.

    Start opens a ne CMD instance to run what follows.
    "" is a blank title for the new CMD instance
    /Wait pauses the execution of the batch until the "started" operation finishes

     
  • Adrian Smith

    Adrian Smith - 2010-08-06

    I ran your script; it works but still waits for my input to close the window.
    I'll try win xp

     
  • ebloch

    ebloch - 2010-08-06

    I am on Win 7 Home Premium 64 bit and my batch should work on any recent Win.

    There should only be ONE space between each of the command elements.

    I suggest making a simple one line batch for testing.

    Obviously substitute your user name for the ... shown.

    Check that the folders you specify actually exist. I suggest a folder for
    testing should be on your desktop.

     
  • Adrian Smith

    Adrian Smith - 2010-08-06

    Here is my script - ignore the part with 7 Zip since it will not work. it is
    designed to work from a removable device.

    ECHO OFF
    REM BATCH PROGRAM THAT WILL USE DRIVER BACKUP 2, KEYFINDER AND 7 ZIP
    REM TO BACKUP ALL THE DRIVERS AND KEY INFORMATION TO A FOLDER, 
    REM THEN, COMPRESS THAT FOLDER TO A ZIP ARCHIVE,
    REM DELETE THE ORIGINAL FOLDER AND MOVE THE ARCHIVE UP ONE LEVEL
    REM ALL FILE INVO WILL HAVE COMPUTERNAME IN IT
    cd bin
    REM makes a directory with computer name followed by _INFO
    REM where all the data will be temporary stored
    md %computername%_INFO
    REM extract all keys information to that folder
    keyfinder /save %COMPUTERNAME%_INFO\ /close /file KeysInformation.txt
    REM Run Driver Backup and extract separate folders for each device to the same folder
    drvbk MODE="BACKUP" BKPATH="%computername%_INFO" OPT="AL" BKFILE="%DATE%.bki" BKDEVFMT="%DEVNAME%"
    
    REM Add data to the archive
    7z a %computername%_INFO.7z %computername%_info\
    REM Delete temporary folder with all data
    rmdir /S /Q %computername%_INFO 
    REM Move the archive a folder up for ease of finding
    CD..
    move bin\%computername%_info.7z 
    pause
    
     
  • Adrian Smith

    Adrian Smith - 2010-08-06

    And then this is your version; it still waits for my input:

    Start "" /Wait "C:\Users\avasile\Desktop\Apps\DrvBK_21\bin\drvbk.exe" MODE="BACKUP" BKPATH="C:\Users\avasile\Desktop\Apps\DrvBK_21\bin" BKFILE="Backup %DATE% from i7.bki" BKPATHFTM="Drivers i7 %DATE%" OPT="ARLW" LOG="C:\Users\avasile\Desktop\Apps\DrvBK_21\bin\Backup.log"
    
     
  • ebloch

    ebloch - 2010-08-06

    I do not have time right now to look thru your entire batch but:
    - why do cd bin? If you insist on it then use complete path.
    - before md should use: "if not exist" or "if exist" on that directory and rd md if exists then make new
    due to possible previous abnormal termination
    - use the complete file path to drvbk command, with "" if contains spaces
    - add log spec to drvbk so can see what happened when it runs
    -7zip should work if its command is good so REM out that command for tests

    It is always best to use complete paths when ever you use a file or program.
    That may be your problem in 7 zip.

     
  • Adrian Smith

    Adrian Smith - 2010-08-06

    Well I intent to use this tool from a removable USB Drive; therefore i will
    not know the absolute path since the drive will get different letters on a
    different machines.
    To answer your questions:
    - CD BIN - I wanted to arrange all the apps inside the folder BIN and leave only the script outside. I used cd bin so that the script will start the software inside that folder
    - the folder created by the apps will be deleted so there is no need to check for its existence
    - then the paths again - I wish I can do this but not with a removable device
    I guess I'll use it like this; I'll try running in on the root drive to see if
    it makes a difference

     
  • Adrian Smith

    Adrian Smith - 2010-08-06

    I even tried the wizard to generate the command line and it still waits for
    Enter to close the window.

     
  • ebloch

    ebloch - 2010-08-06

    My experience with the wizard also failed. one of the main reasons was that it
    created a command line with TWO spaces between each item and it will only work
    with ONE space.

    Read thru my problems and solutions at https://sourceforge.net/projects/drvba
    ck/forums/forum/607907/topic/3416588

    I believe there are methods to establish what the drive letter is for a USB
    stick. ask in the newsgroup alt.msdos.batch.nt or search the info at http://w
    ww.netikka.net/tsneti/info/tscmd.php

    If run manually I think that you should add to your batch an operator input
    asking the drive letter of the USB stick and then assign a variable using SET
    XYZ= to that drive letter and use the variable %XYZ% in your batch for all
    subsequent commands.

    I do not know why you are using a USB stick because your batch plus data will
    take up very little disk space and the data can be incorporated into your
    normal backup routine.

    Every night I run an unattended batch to do various housekeeping routines
    followed by a different batch every day followed by a data backup to a NAS.
    One day a week a batch runs drvbk using the command line I offered before. The
    data folder is included in the backup which is done by Karen's Replicator
    (free) at http://www.karenware.com/powertools/ptreplicator.asp

    Everything I read indicates that USB sticks have a finite life and are not the
    best backup media unless the stick is checked for errors on a routine basis.

     
  • Gvb

    Gvb - 2010-08-07

    In 2.1 version there is "V" option in OPT="" tag. This option forces program
    to close is command line window when backup or restore process is ended.

    %DATE% must be replaced with %NOW%

     
  • ebloch

    ebloch - 2010-08-07

    I have been using Drvrk2 (not 2.1) because I did not know the new version was
    available.

    I have d/l the new version and will test it.

    I do see the new date format and %N0W%.

    The "V" tag is listed for verbose logging and the "R" tag is not mentioned at
    all.

     
  • ebloch

    ebloch - 2010-08-07

    After some testing v2.1 I find that
    - The backup file ALWAYS has a date in the name defaulting to mm-dd-yyyy
    - The "R" tag is a Restoration option as before
    - The "W" tag is a Log overwrite option as before
    - The "V" tag does close DrvrBK even though listed for Verbose Logging.

    Here is my new batch command line:
    Start "" /Wait "C:\Users\Eric\DriverBackup21\DrvBK.exe" MODE="BACKUP"
    BKPATH="C:\Users\Eric\DriverBackup21" BKFILE="Backup from i7.bki"
    BKPATHFTM="Drivers i7" OPT="ARLWV"
    LOG="C:\Users\Eric\DriverBackup21\Log\Backup.log"

    Note that the first time DrvrBK runs it copies all necessary files into the
    data folder set by BKPATH so that for following runs you will find the exe
    there also and it is not necessary to use a C:|Program Files\ or C:|Program
    Files (x86)\ construction.

    To use a USB stick with DrvrBk moving it from machine to machine I suggest
    that you assign the SAME specific drive letter on each machine to the USB port
    to be used. Note that you must always then use the same USB port if you have
    multiple ports on a machine.

     
  • Gvb

    Gvb - 2010-08-07

    You can specify date format using this tag BKDATEFMT="#dateformat#"

    more information about date format are included in help guide.

     
  • ebloch

    ebloch - 2010-08-07

    I was just pointing out that without specifying %DATE% in the file format the
    current date was added anyway.

     
  • Adrian Smith

    Adrian Smith - 2010-08-09

    You are right about the "V" tag - I contacted the author and that did the
    trick. i did not see that in help file though.
    So V did the trick.
    See, I use this tool with 7 Zip and KeyFinder when I work on customer's
    computer - before I reinstall, this script will save me all the drivers and
    Windows information that I can reuse at re-install.
    Thank you for your help.

     
  • ebloch

    ebloch - 2010-10-04

    After more testing I find that in order to use the date option the command is:
    BKDATEFMT="yyyy-MM-dd" to produce 2010-10-04
    Note that MM produces two digit months NOT the more normal mm

    -- Here are my new command lines:
    Set SRC=C:\Users\Eric\DriverBackup21
    Start "" /Wait "%SRC%\DrvBK.exe" MODE="BACKUP" BKPATH="%SRC%" BKFILE="Backup
    from i7.bki" BKDATEFMT="yyyy-MM-dd" BKPATHFTM="Drivers i7 " OPT="ARLWV"
    LOG="%SRC%\Log\Backup.log"

    Above "Start" command is on one line and produces folders named:
    "C:\Users\Eric\DriverBackup21\Drivers I7 2010-10-04"

    Then adding the following to my batch limits the number driver folders to 8;
    cd %SRC%
    for /f "skip=8 delims=" %%a in ('dir /ad /o-n /b "Drivers i7*"') do rd /s /q
    "%%a"
    cd C:\

     
  • ebloch

    ebloch - 2011-02-02

    Now using DrvBK_21_Rev5 with: Set SRC=C:\Users\Eric\DrvBK_21_Rev5\

    Required change in command line with **BKPATHFTM ** no longer required:
    Start "" /Wait "%SRC%DrvBK.exe" MODE="BACKUP" LOG="%SRC%Backup.log" OPT="ALV"
    BKPATH="%SRC%" BKFILE="%SRC%Backup from i7.bki" BKDATEFMT="yyyy-MM-dd"

    To result in backup file: "C:\Users\Eric\DrvBK_21_Rev5\Drivers I7 2011-02-02"

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.