Okay I have been searching google and the internet to find a solution to my problem. Let me start by saying I have no programming training and am teaching myself how to program by reading peoples code and trying to use it where I need it.
What I'm trying to accomplish is our office back's up each individual computer every Friday. The gal that is in charge of distributing the backup's is not computer savvy and doesn't have the time to back up peoples files for them. One coworker who is also the boss is so busy, backing up is on the bottom of his list of things to do. He also has the most important information on his computers that should be backed up. So we can go weeks or months without backing up his computers. What I'm trying to accomplish, if it's possible is to write a code that would either automatically back up the files I need, once the USB is inserted, or it would pop up a dialog box and say back up computer 1 or computer 2? Then you press that button and it would backup the files for that computer. I would like to keep this program on the USB so I don't have to install unnecessary programs on the bosses computers.
I've read several articles that show how to run a autorun program on a USB but now Windows 7 has taken that feature away unless you get a special USB drive. So I'm not sure what my options are I just want something that will be simple for her to use.
Computer 1 is running windows 7 and I tried creating a bat file that would run robocopy to copy the folders I needed but I keep getting an access denied prompt and it wont copy any of them.
Computer 2 is running windows xp and wouldn't recognize the robocopy as a command so I had to write a bat file that was xcopy and that seamed to work well except I couldn't get the Word Documents to copy.
Was wondering if there is a way to program a dialog box to pop up when the USB is inserted and then have the buttons execute the bat files, once they are working properly of course. I would like to have all the data in place so she wouldn't have to browse for what files need to be backed up. I mean we already just copy and paste for our backup so I'm trying to eliminate that so it a one easy step for her and she could walk away and come back to a notification that said completed. Maybe if I could program a progress bar that would be helpful too?
I thought this would be a simple task to write a program that automatically copied files but I was wrong!
Any help would be greatly appreciated.
robocopy.bat
xcopy.batCode:robocopy "c:\data1" "F:\data1" /e /fft /np /log+:backup_log.txt robocopy "c:\data2" "F:\data2" /e /fft /np /log+:backup_log.txt pause
Code:@echo off echo ------------------- echo Removable Device Automatic Backup echo ------------------- echo date /t>>backup_log2.txt time />>backup_log2.txt xcopy "c:\file path to copy" "file path of new location" /Y /E /R>>backup_log2.txt xcopy "c:\file path to copy" "file path of new location" /Y /E /R>>backup_log2.txt xcopy "c:\file path to copy" "file path of new location" /Y /E /R>>backup_log2.txt xcopy "c:\file path to copy" "file path of new location" /Y /E /R>>backup_log2.txt echo Backup Complete! pause.
I know that this isn't VB code and it was created in a notepad but am hopeful someone out there can help me out or point me in some good directions to learn this.




Reply With Quote