Auto-backup Network Server files to USB Flash Drive when Drive Plugged in

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maiqr
    PCHF Member
    • Jul 2019
    • 16

    #1

    Auto-backup Network Server files to USB Flash Drive when Drive Plugged in

    Hello,

    I have a need to back-up the files I keep on shared network drive; Lets call it G:. My goal being when I plug in my flash drive to my computer connected to that network, it automatically copies the files in question on the network drive to my flash drive; Lets call it D:.

    This link details the directions I used to make the files that execute the commands on my USB Flash Drive. I thought it would work the way I did it but obviouslyโ€ฆ

    Before you ask, this is for work purposes and I cannot just auto-backup with the windows 10 utility because I do not possess admin rights over my work computer. This also keeps me from using 3rd party software to accomplish my task with these files.

    How should I go about getting this to do what I need it to do?

    Thanks in advance

    Below is the code for each file:

    [COLOR=rgb(247, 218, 100)]Autorun.inf -

    [autorun]

    icon=drive.ico

    open=launch.bat

    action=Click ok to Run game for Windows

    shell\open\command=launch.bat


    [COLOR=rgb(247, 218, 100)]file.bat -

    @echo off

    :: variables

    /min

    SET odrive=%odrive:~0,2%

    set backupcmd=xcopy /s /c /d /e /h /i /r /y

    echo off

    %backupcmd% โ€œ%rjg00005%\G:\Engineering\AB Programsโ€ โ€œ%D:%\AB Programsโ€

    @echo off

    cls


    [COLOR=rgb(247, 218, 100)]invisible.vbs -

    CreateObject(โ€œWscript.Shellโ€).Run โ€œโ€โ€œโ€ & WScript.Arguments(0) & โ€œโ€โ€œโ€, 0, False


    [COLOR=rgb(247, 218, 100)]launch.bat -

    wscript.exe \invisible.vbs file.bat[/COLOR][/COLOR][/COLOR][/COLOR]
  • Bruce
    PCHF Moderator
    • Oct 2017
    • 10702

    #2
    a networked, work PC that allows users to run VBS scripts - what could possibly go wrong with that scenario!

    why your network administrator would allow such a thing is frankly amazing.
    and thereโ€™s a reason why you donโ€™t have admin rights!

    Comment

    • veeg
      PCHF Director
      • Jul 2016
      • 8982

      #3
      Sorry but as per rule: 15. PCHF can not and will not offer advice for business use or financial gain. PCHF only offers assistance for personal use.

      Comment

      Working...