Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


xpd



SysOp
10252 posts

Uber Geek

Mod Emeritus
Trusted
Lifetime subscriber

# 38350 28-Jul-2009 14:58
Send private message

Nice simple one for someone (i hope).... which for some reason I cant figure out or find a simple solution... :)

Ive whipped up a script (on windows 2003) as follows :

dir /S *.mp3 >c:\temp\mp3_%date%.txt

My problem is whenever it runs, the output file is "mp3_Tue" - I require the whole date preferably like 28072009 or similar.

How the fudge do I get it to do this ? All the information Ive found via Google points to running a 20 line script just to create the date variable.... gotta be easier way than that.





XPD / Gavin / DemiseNZ

 

Server : i5-3470s @ 3.50GHz  16GB RAM  Workstation : Ryzen 5 3600 / 16GB DDR4 / RX580 4GB    Console : Xbox One

 

Now on BigPipe 100/100 and 2Talk  Add me on Steam   My Lego

 

Current Projects : Arcade Machine          BBS (WIP)


Create new topic
187 posts

Master Geek


  # 239774 28-Jul-2009 15:13
Send private message

try:

dir /S *.mp3 > "c:\temp\mp3_%date%.txt"

187 posts

Master Geek


  # 239777 28-Jul-2009 15:15
Send private message

changing the short date format under "Regional and Language options give you some variation on the format of %date%

 
 
 
 


xpd



SysOp
10252 posts

Uber Geek

Mod Emeritus
Trusted
Lifetime subscriber

  # 240101 29-Jul-2009 12:42
Send private message

Turns out there is no easy way.... so have to add 5-15 lines to my script to get it to work.... wouldve thought it was an easy thing to do for an advanced system like Windows :-p




XPD / Gavin / DemiseNZ

 

Server : i5-3470s @ 3.50GHz  16GB RAM  Workstation : Ryzen 5 3600 / 16GB DDR4 / RX580 4GB    Console : Xbox One

 

Now on BigPipe 100/100 and 2Talk  Add me on Steam   My Lego

 

Current Projects : Arcade Machine          BBS (WIP)


187 posts

Master Geek


  # 240104 29-Jul-2009 12:54
Send private message

ok for only an additional line of code try:
dir /S *.mp3 > c:\temp\mp3_temp.txt
ren c:\temp\mp3_temp.txt c:\temp\mp3_%date:~4,2%-%date:~7,2%-%date:~10,4%_@_%time:~0,2%h%time:~3,2%m%time:~6,2%s%.txt

for debugging purposes use:
echo %date:~4,2%-%date:~7,2%-%date:~10,4%_@_%time:~0,2%h%time:~3,2%m%time:~6,2%s%

to play around with the formatting.

xpd



SysOp
10252 posts

Uber Geek

Mod Emeritus
Trusted
Lifetime subscriber

  # 240119 29-Jul-2009 13:14
Send private message

Hmm not a bad idea actually, Im not in forward thinking mode :) Thanks, Ill give that a shot :)




XPD / Gavin / DemiseNZ

 

Server : i5-3470s @ 3.50GHz  16GB RAM  Workstation : Ryzen 5 3600 / 16GB DDR4 / RX580 4GB    Console : Xbox One

 

Now on BigPipe 100/100 and 2Talk  Add me on Steam   My Lego

 

Current Projects : Arcade Machine          BBS (WIP)


Create new topic



Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Ring launches indoor-only security camera
Posted 23-Jan-2020 17:26


New report findings will help schools implement the digital technologies curriculum content
Posted 23-Jan-2020 17:25


N4L to upgrade & support wireless internet inside schools
Posted 23-Jan-2020 17:22


Netflix releases 21 Studio Ghibli works
Posted 22-Jan-2020 11:42


Vodafone integrates eSIM into device and wearable roadmap
Posted 17-Jan-2020 09:45


Do you need this camera app? Group investigates privacy implications
Posted 16-Jan-2020 03:30


JBL launches headphones range designed for gaming
Posted 13-Jan-2020 09:59


Withings introduces ScanWatch wearable combining ECG and sleep apnea detection
Posted 9-Jan-2020 18:34


NZ Police releases public app
Posted 8-Jan-2020 11:43


Suunto 7 combine sports and smart features on new smartwatch generation
Posted 7-Jan-2020 16:06


Intel brings innovation with technology spanning the cloud, network, edge and PC
Posted 7-Jan-2020 15:54


AMD announces high performance desktop and ultrathin laptop processors
Posted 7-Jan-2020 15:42


AMD unveils four new desktop and mobile GPUs including AMD Radeon RX 5600
Posted 7-Jan-2020 15:32


Consolidation in video streaming market with Spark selling Lightbox to Sky
Posted 19-Dec-2019 09:09


Intel introduces cryogenic control chip to enable quantum computers
Posted 10-Dec-2019 21:32



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.