Batch file: Worked in Win7/32, doesn't work in Win10/64

Page 1 of 2 12 LastLast

  1. Posts : 43
    Windows 7
       #1

    [Hobocopy] Batch file: Worked in Win7/32, doesn't work in Win10/64


    Hello,

    The following batch file is used by my daily backup application to copy several important files, zip them (with a password), and copy the zip file to a second computer and remote FTP.

    It worked on my old 32-bit Win7 computer, but it doesn't on my new 64-bit Win10 computer.

    It also displays this message several times: "Do you want to allow this app from an unknown publisher to make changes to your device?"

    Starting the Volume Shadow Copy service makes no difference.

    Is there another free, CLI alternative application that can copy locked files?

    Thank you.

    Backup.bat:
    @echo off

    SET basedir=c:\Temp\Backup\

    Echo Clean up
    cd %basedir%
    c:
    del *.zip *.pst *.aes

    Echo VSS copy
    %basedir%HoboCopy.exe c:\Documents\Outlook\ %basedir% MyFile.pst
    %basedir%HoboCopy.exe c:\Documents\AES\ %basedir% blah.txt.aes aescrypt.exe

    Echo ZIP passwd
    %basedir%7za.exe -tzip -pmypasswd %basedir%Backup.zip %basedir%MyFile.pst %basedir%blah.txt.aes %basedir%aescrypt.exe

    Echo Copy to local backup computer
    del \\backup\Backup.zip
    copy %basedir%Backup.zip \\backup

    Echo Copy to FTP
    %basedir%ncftpput.exe -u me -p mypasswd ftp.acme.com / %basedir%Backup.zip

    msg * Backup done!


    Run:
    Clean up
    VSS copy
    HoboCopy (c) 2011 Wangdera Corporation. hobocopy@wangdera.com

    Starting a full copy from c:\Documents\Outlook\ to c:\Temp\Backup\
    There was a COM failure 0x80042302 - HoboCopy.cpp (181)
    HoboCopy (c) 2011 Wangdera Corporation. hobocopy@wangdera.com

    Starting a full copy from c:\Documents\AES\ to c:\Temp\Backup\
    There was a COM failure 0x80042302 - HoboCopy.cpp (181)
    HoboCopy (c) 2011 Wangdera Corporation. hobocopy@wangdera.com

    ZIP passwd

    7-Zip (a) 18.05 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2018-04-30

    Scanning the drive:
    1 file, 144384 bytes (141 KiB)

    Creating archive: c:\Temp\Backup\Backup.zip

    Add new data to archive: 1 file, 144384 bytes (141 KiB)

    Files read from disk: 1
    Archive size: 82722 bytes (81 KiB)
    Everything is Ok
    Copy to local backup computer
    1 file(s) copied.
    Copy to FTP
    'msg' is not recognized as an internal or external command, operable program or batch file.
    Last edited by Winfried; 12 Sep 2023 at 06:13.
      My Computer


  2. Posts : 8,111
    windows 10
       #2

    The thing to do is either run each line by hand from CMD line or put pause in the script at a few points to see what's failing it's the only way to debug
      My Computer


  3. Posts : 43
    Windows 7
    Thread Starter
       #3

    Thanks. Either the 32-bit version of Hobocopy is missing its VC++ runtime (no idea which one), or it doesn't work on a 64-bit Windows… but the 64-bit version of Hobocopy is nowhere to be found, and it's no longer under developpement.

    RawCopy (an AutoIt script, last updated Aug 1, 2017) might be an alternative, although it seems to require admin rights to work (otherwise: "Error in function CreateFile: Access is denied. for: \\.\d: CreateFile: Access is denied."):

    RawCopy.exe /FileNamePath:c:\Documents\input.txt /OutputPath:d:\Temp\Backup /OutputName:input.txt
      My Computer


  4. Posts : 42,999
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #4

    HoboCopy is a backup/copy tool. It is inspired by robocopy in both name and in functionality.
    - is there any reason why you couldn't use Robocopy?
      My Computers


  5. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #5

    Hello @Winfried,

    I have never heard of hobocopy or used it.

    I just investigated this for you and found this on GitHub [ Source: > hobocopy ]:

    Batch file: Worked in Win7/32, doesn't work in Win10/64-image.png

    It appears that there has been NO updates in 13 years.

    With that in mind, have you looked into or considered XCopy, RoboCopy, TeraCopy, FreeFileSync, or even CMD Prompt or PowerShell?

    Here are just a few links that you might find informative and useful . . .

     XCopy:

    > XCopy - DocsMicrosoft
    > XCopy - TechRepublic
    > XCopy - SS64

     RoboCopy:

    > RoboCopy - DocsMicrosoft
    > RoboCopy - TechRepublic
    > RoboCopy - SS64

    NOTE:- To view RoboCopy Commands in a CMD Prompt, type robocopy /? and press Enter.

    To output the Commands to a .txt file, type robocopy /? > %UserProfile%\Desktop\RoboCopy.txt. Obviously change the output Path to your own.

     TeraCopy:

    > TeraCopy - CodeSector
    > TeraCopy - Copying and Verifying Files - CodeSector

    I have NOT personally used TeraCopy.

     FreeFileSync:

    > FreeFileSync

     CMD Prompt:

    > CMD Prompt - Copy - DocsMicrosoft
    > CMD Prompt - How to Copy Files in CMD Prompt - WikiHow



    I hope this helps.
      My Computer


  6. Posts : 776
    Windows 7
       #6

    Looking over HoboCopy's GitHub, it requires a copy of Microsoft Visual C++ 2005 Redistributable.

    As for the "Do you want to allow this app from an unknown publisher to make changes to your device?" warning, one or more of your executables needs to be unblocked.

    Follow this tutorial:
    How to Unblock a File in Windows 10
      My Computer


  7. Posts : 419
    Win 7 Pro/32, Win 10 Pro/64/32
       #7

    I saw one thing, that tells me that maybe you need to disable UAC! Have you done that yet?

    It's one of the first things I do after a clean install of Windows. Here's a little registry script that does the job.
    Or, you can just go into the registry and do it manually.

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
    "EnableLUA"=dword:00000000
      My Computer


  8. Posts : 43
    Windows 7
    Thread Starter
       #8

    Thanks everyone for the infos.

    Robocopy/xcopy won't do because I need to copy files that are in use (locked)… which hobocopy could do.

    I'll install Microsoft Visual C++ 2005 Redistributable, unblock the program, and… give it another try.
      My Computer


  9. Posts : 42,999
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #9

    Copy Locked or In Use Files: 7 Best Tools to Use
    - Shadowspawn - later fork of Hobocopy.

    Uninstalling and reinstalling Hobocopy might work if installing VC++ runtime doesn't succeed.

    Recommend using System Restore points to protect yourself whilst experimenting.
      My Computers


  10. Posts : 43
    Windows 7
    Thread Starter
       #10

    Turns out I had a more recent VC++ package, so that doesn't explain the COM error.

    The file doesn't appear to be blocked — no item in its Properties.

    Shadowspawn, by the same author, is itself deadware, and isn't as nice to use when you only need to copy specific files (shadowspawn C:\foo Q: robocopy Q:\ C:\bar /s).

    Hobocopy requires no installation: It's just a single EXE.

    RawCopy (an AutoIt script) didn't work either.
    RawCopy.exe /FileNamePath:c:\Documents\blah\blah.txt
    RawCopy v1.0.0.19
    Error in function CreateFile: Access is denied.
    for: \\.\c:
    CreateFile: Access is denied.


    I'll keep looking for a CLI application (it's for a batch file) that supports Windows' Volume Shadow Service.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:33.
Find Us




Windows 10 Forums