|
|||||||||
|
|
|||||||||
|
Advanced Computer Discussion Talk about more advanced computer related subjects in here. i.e. programming, networking, OS configurations, etc. |
|
||||||
|
& Great Prizes! |
|
& Degrees |
|
|
| Join GeneralForum.com Today! |
Join GeneralForum.com today for FREE!GeneralForum.com is the fastest growing general forum on the web!
» 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.
» 30-Day Satisfaction Guarantee! Click HERE to get started! |
![]() |
|
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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%
Last edited by Mr_Snipes; 06-03-2007 at 12:52 PM.. |
|
#5
|
|||
|
|||
|
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 |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
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 |