General Forum - Forums about everything!




Advanced Computer Discussion Talk about more advanced computer related subjects in here. i.e. programming, networking, OS configurations, etc.

Go Back   General Forum > General > Technology > Computers > Advanced Computer Discussion

» Sponsored Ads
 



160X600 - Love Your New Phone

Reply
 
Thread Tools Display Modes
  #1 
Old 06-02-2007, 05:32 AM
Hybrix's Avatar
Hybrix
Través del Espejo
 
Dynamic variables in a .bat file?

Does anyone here know how I can create a .bat file dynamically and then run it? Is this something that I would do in ASP/

Basically I am looking to run a single line of code but one part of it will need to be different each time the file is loaded.

Any ideas?



Join GeneralForum.com Today!

Join GeneralForum.com today for FREE!

GeneralForum.com is the fastest growing general forum on the web!

  • Join thousands of discussions on every topic imaginable!
  • Chat with people from all over the world in real time!
  • Play live games with other members in real time! 
  • Make new friends, discuss new ideas, talk about whatever!
  • Yes, it's free! What are you waiting for? DO IT NOW!
» Click here to join the fun!

  #2 
Old 06-02-2007, 06:47 PM
Mr_Snipes's Avatar
Mr_Snipes
Registered Member
 
I am not sure if you can get a .bat to be created and run on the fly.

What are you trying to do?
  #3 
Old 06-02-2007, 08:29 PM
Hybrix's Avatar
Hybrix
Través del Espejo
 
I am trying to set something to backup every day and put the date in the name of the file that is created.
  #4 
Old 06-03-2007, 01:50 PM
Mr_Snipes's Avatar
Mr_Snipes
Registered Member
 
Here is the code for a .bat file to create a filename using today's date

Code:
@echo off
:: set a variable for placing today's date
set getDate=none
:: get todays date and set it in the variable
for /F "tokens=2-4 delims=/ " %%a in ('date /t') do set getDate=%%a%%b%%c
:: create the new File name and place it in a variable
set newName=databasebackup%getDate%.sql
:: create the file using the variable it was placed in
type NUL>%newName%
You may need to play with it a little bit depending on what you have for a delimiter and how it echos the date

Last edited by Mr_Snipes; 06-03-2007 at 01:52 PM..
  #5 
Old 06-03-2007, 06:34 PM
Hybrix's Avatar
Hybrix
Través del Espejo
 
Awesome that worked.

Thanks! That will make my life a lot easier, well at least part of it.
Closed Thread

  General Forum > General > Technology > Computers > Advanced Computer Discussion

Bookmarks



Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
After merging partitions, file can't show...! iamgood General Tech 7 12-27-2006 07:55 PM
Connecting a Dynamic Microphone to the PC. JohnR General Tech 3 11-04-2006 09:51 PM
Loading a text file into Sql Server abbysomeone00 General Tech 8 08-01-2006 10:23 AM
Video File Dragon Auction Management 1 09-13-2005 03:56 PM



 


All times are GMT -6. The time now is 11:43 PM.

Powered by: vBulletin | Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Site designed and maintained by NURV® Original Concepts, Graphics, and Design Copyright © NURV® 2010
All user submitted content, threads and posts becomes the copyright-protected property of GeneralForum.com unless previously copyrighted.
The views and opinions expressed on this site are not necessarily the views of the staff or administration.
We are not responsible, nor can we be held liable for information posted on this site, or what it influences you to do.
Rules & Privacy Policy

3D Motion Graphics | Poker Design | Web Design | Mafia Graphics | Pop Culture News | Money Forum | Make Money Online | Stephen King