|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Functions and Batch files? Incremental copying?
Ok. I'm an access person and the "computer guy" at work asked me about batch files. I don't know anything about batch files except what I've read online the last couple of days.
Here's what we're looking for. We just got new registers at work and the background system is running on windows. There's a buch of mdb filoes but no access, so it's running SQL (confirmed from helpdesk). Every day, at close of the business day, the system creates snapshot file(s) with the closing reports. Unfortunately, come the next day, those files are overwritten with new ones, so unless someone goes in there and physically copies them to another folder on the network, they're lost. He'd like to know if there's a batch file code that will either automatically create a new folder (or file) in the destination directory that increments by one or name it by current date (preferred), or send a prompt where the user can type in the date. Does that makes sense? As I'm typing this, I'm wondering if there's a simple VB code for this. I haven't coded VB since school Any help is appreciated. Thanks. Jim
__________________
Just hoping I can give as much as I get from here
|
|
#2
|
||||
|
||||
|
Sorry Jim, wrong forum
![]() The code Bank is only for code samples not for programming help. Anyhow, this batch file, does it have to fire on a time basis? Batch files are the long forgotten children of windows and are seldomly used (though they're quite powerful, if coded correctly) All this can be done in a batch file without VB of any kind. Plus it can be scheduled using the task scheduler to run at a set time.
__________________
................... ASCII and ye shall receive .................. Knowledge is the only resource on earth that multiplies when shared Support the Shemzilla Project Powered by C# |
|
#3
|
||||
|
||||
|
Thanks and sorry. It's not a time thing. He, or someone in management, would just click the file icon after the close of the books, and be done with it...hopefully.
Again, any help is appreciated. Last edited by OneRedLT4 : April 4th, 2006 at 01:37 PM. |
|
#4
|
||||
|
||||
|
Hmmm, maybe I should try a different forum?
|
|
#5
|
||||
|
||||
|
--moved to the Programming Help forum.
Jim, the best and most simple thing to do is creating small application that will do the job.. I can do something in C# for you if you want let me know and I'll do that when i'll have some time. should take me no more than 10 minutes. ![]() |
|
#6
|
||||
|
||||
|
Quote:
Thanks for moving the thread, I was just logging in to repost here. I don't know if he knows any C# so I'd hate for you to waste your time. I don't know how similar C# is to the batch lingo. However, I'd never turn down an opportunity to accept help, especially when i can learn from it. Thanks. |
|
#7
|
||||
|
||||
|
ok then, I'll create something simple that will accept command line arguments and be
as flexible as possible. remind me within couple of days.. ![]() |
|
#8
|
||||
|
||||
|
Quote:
Will do, thanks ![]() Meanwhile, just incase, anyone know how to do in Batch? Hmm, wonder if can do in Access.... ![]() |
|
#9
|
||||
|
||||
|
attached is command line application that get file path as
its first argument and folder path as the second argument, and will copy the given file to the given folder while giving the file name in the format: [original name]_DDMMYYYY.[original extension] in the destination folder. for example this command: SmartBackup.exe C:\test.txt C:\MyFolder will copy the file test.txt from C:\ into C:\MyFolder\test_09042006.txt attached is also sample batch file that will automatically copy one file in single click. let me know if there are any further questions, attached is also the C# source code. |
|
#10
|
||||
|
||||
|
Quote:
Cool! I'll have to look at it and try to learn something. What is the exe file? Is that really complicated to learn how to create it to use the attached file for info? You know, one thing I have notice about this forum, is that so many of you are so damn smart when it comes to this stuff!! While you were whipping out this really cool piece of coding, I lucked out and found the pieces needed to construct it in a batch file. I've included it below incase anyone's interested. I've now slightly modded it to backup both ways folders and files between my laptop and my desktop. Code:
@echo off
:: variables
set drive=K:\Backup
set folder=%date:~10,4%_%date:~4,2%_%date:~7,2%
set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
echo ### Backing Daily closing Reports...
%backupcmd% "C:\closing reports\daily" "%drive%\%folder%"
echo Backup Complete!
@pause
Last edited by OneRedLT4 : April 12th, 2006 at 03:04 AM. |
|
#11
|
||||
|
||||
|
that's really cool code, looks like that's what you were after.
![]() in the attached zip there is exe file you can use, but if you got it working via pure batch code it's better. ![]() |
![]() |
| Viewing: ASP Free Forums > System Administration > Windows Scripting > Functions and Batch files? Incremental copying? |
| Thread Tools | Search this Thread |