Windows Scripting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationWindows Scripting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 3rd, 2006, 10:44 PM
OneRedLT4's Avatar
OneRedLT4 OneRedLT4 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: California
Posts: 299 OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 21 h 7 m 10 sec
Reputation Power: 9
Send a message via AIM to OneRedLT4 Send a message via Yahoo to OneRedLT4
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

Reply With Quote
  #2  
Old April 3rd, 2006, 10:54 PM
lewy's Avatar
lewy lewy is offline
Alter Ego Wizard
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Edinburg Tx
Posts: 4,395 lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)lewy User rank is General 10th Grade (Above 100000 Reputation Level)  Folding Points: 1009 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 2 Days 5 h 10 m 51 sec
Reputation Power: 1652
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#

Reply With Quote
  #3  
Old April 3rd, 2006, 11:29 PM
OneRedLT4's Avatar
OneRedLT4 OneRedLT4 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: California
Posts: 299 OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 21 h 7 m 10 sec
Reputation Power: 9
Send a message via AIM to OneRedLT4 Send a message via Yahoo to OneRedLT4
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 12:37 PM.

Reply With Quote
  #4  
Old April 6th, 2006, 12:28 AM
OneRedLT4's Avatar
OneRedLT4 OneRedLT4 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: California
Posts: 299 OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 21 h 7 m 10 sec
Reputation Power: 9
Send a message via AIM to OneRedLT4 Send a message via Yahoo to OneRedLT4
Hmmm, maybe I should try a different forum?

Reply With Quote
  #5  
Old April 6th, 2006, 03:50 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 29,260 Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 2 Days 30 m 22 sec
Reputation Power: 2509
--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.

Reply With Quote
  #6  
Old April 7th, 2006, 02:27 PM
OneRedLT4's Avatar
OneRedLT4 OneRedLT4 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: California
Posts: 299 OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 21 h 7 m 10 sec
Reputation Power: 9
Send a message via AIM to OneRedLT4 Send a message via Yahoo to OneRedLT4
Quote:
Originally Posted by Shadow Wizard
--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.

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.

Reply With Quote
  #7  
Old April 7th, 2006, 02:29 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 29,260 Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 2 Days 30 m 22 sec
Reputation Power: 2509
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..

Reply With Quote
  #8  
Old April 9th, 2006, 12:42 AM
OneRedLT4's Avatar
OneRedLT4 OneRedLT4 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: California
Posts: 299 OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 21 h 7 m 10 sec
Reputation Power: 9
Send a message via AIM to OneRedLT4 Send a message via Yahoo to OneRedLT4
Quote:
Originally Posted by Shadow Wizard
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..


Will do, thanks

Meanwhile, just incase, anyone know how to do in Batch?
Hmm, wonder if can do in Access....

Reply With Quote
  #9  
Old April 9th, 2006, 08:22 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 29,260 Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 2 Days 30 m 22 sec
Reputation Power: 2509
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.
Comments on this post
OneRedLT4 agrees: Friggin' awesome stuff!!!
Attached Files
File Type: zip SmartBackup.zip (2.9 KB, 497 views)

Reply With Quote
  #10  
Old April 12th, 2006, 01:08 AM
OneRedLT4's Avatar
OneRedLT4 OneRedLT4 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: California
Posts: 299 OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level)OneRedLT4 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 21 h 7 m 10 sec
Reputation Power: 9
Send a message via AIM to OneRedLT4 Send a message via Yahoo to OneRedLT4
Quote:
Originally Posted by Shadow Wizard
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.

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 02:04 AM.

Reply With Quote
  #11  
Old April 12th, 2006, 07:44 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 29,260 Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587027 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 2 Days 30 m 22 sec
Reputation Power: 2509
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationWindows Scripting > Functions and Batch files? Incremental copying?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek