Author Topic: Programmer/Scripting help!  (Read 365 times)

0 Members and 1 Guest are viewing this topic.

Offline CrazyCracka420

  • Minute Valuable Contributor
  • Strategus Councillor
  • **
  • Renown: 1950
  • Infamy: 794
  • cRPG Player Sir White Pawn A Gentleman and a Scholar
  • Welp
    • View Profile
  • Faction: Vaegirs
  • Game nicks: Huseby
  • IRC nick: Steam name: crazycracka420
Programmer/Scripting help!
« on: July 06, 2012, 05:27:02 pm »
0
I'm trying to append the date to a filename that changes daily and not coming up with a good way to do this.  It's in the Windows environment.

Background:  as part of an FTP process I have a batch file that grabs a file from an FTP site, puts it on our network, and appends the date to the name.  This works when the filename is always going to be the same, but when the filename changes daily (the file that I'm grabbing), I can't find a way to append the date to it.  I'm not really programming savvy, and here's what I currently use to append the date (only works however with a static name that never changes, in this instance I've used test.txt as the name I'm appending).

(Top line is just changing directories to where the file is located)

cd /D x:\public\data\external\aric\apps\
for /f "tokens=1-5 delims=/ " %%d in ("%date%") do rename "test.TXT" test_%%g-%%e-%%f.txt
visitors can't see pics , please register or login
 - Stolen from Macropussy

Offline Vodner

  • Duke
  • *******
  • Renown: 526
  • Infamy: 73
  • cRPG Player
  • SaulCanner
    • View Profile
  • Game nicks: SaulCanner
Re: Programmer/Scripting help!
« Reply #1 on: July 07, 2012, 07:04:42 am »
+1