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

Cool Contests
& Great Prizes!
Your Ad Here! Online Colleges
& Degrees
WOW Gold Buy WOW Gold

» Sponsored Ads
 

Two Week FREE Trial of Blockbuster Total Access


160X600 - Love Your New Phone

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!

GF Sponsor

Get Your Dream Phone Free with a Service Plan!

LetsTalk simplifies the process of buying wireless products and services.

  • Choose from thousands of phones and get yours for FREE!
  • Phones include Blackberry, Samsung, LG, T-Mobile, and more for FREE!
  • Compare all of the available cell phones and plans side-by-side.
  • We provide in depth information – on our website and over the phone!
  • We ship 90% of our orders the same day the order is processed by the carriers.
» 30-Day Satisfaction Guarantee! Click HERE to get started!

Reply
 
Thread Tools Display Modes
  #1 
Old 06-02-2007, 04: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?



I did think of asking you to join my little scheme, but somehow I knew, 007's loyalty was always to the mission, never to his friends. ~006

GF is now officially on Facebook: Become a fan today!

You can't make accusations like that without evidence. I ashume that you have some? ~PD President

Counting down to Winter: 130 days 12 hours 25 minutes
  #2 
Old 06-02-2007, 05: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, 07: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.

I did think of asking you to join my little scheme, but somehow I knew, 007's loyalty was always to the mission, never to his friends. ~006

GF is now officially on Facebook: Become a fan today!

You can't make accusations like that without evidence. I ashume that you have some? ~PD President

Counting down to Winter: 130 days 12 hours 25 minutes
  #4 
Old 06-03-2007, 12: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 12:52 PM..
  #5 
Old 06-03-2007, 05: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.

I did think of asking you to join my little scheme, but somehow I knew, 007's loyalty was always to the mission, never to his friends. ~006

GF is now officially on Facebook: Become a fan today!

You can't make accusations like that without evidence. I ashume that you have some? ~PD President

Counting down to Winter: 130 days 12 hours 25 minutes
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 06:55 PM
Connecting a Dynamic Microphone to the PC. JohnR General Tech 3 11-04-2006 08:51 PM
Loading a text file into Sql Server abbysomeone00 General Tech 8 08-01-2006 09:23 AM
Video File Dragon Auction Management 1 09-13-2005 02:56 PM



 


All times are GMT -6. The time now is 12:34 PM.

Powered by: vBulletin | Copyright ©2000 - 2009, 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® 2009
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

Sports Forum | Poker Design | Web Design | Game Forum | Pop Culture News | Money Forum | Money Complex | Stephen King | Free Stuff