What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Make a batch file please?

Make a batch file please?
Author: Message:
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
O.P. Make a batch file please?
Can someone assist with making a batch file that does the following:
take a command line argument as a filename without the path
rename the file to be in the format of mm.dd.yyyy-hh.mm.AA-filename.ext
where the date format is the current date and time ex 11.14.2009-12.00.am-filename.ext

the batch file will be in the same directory as the original file.

thanks? (A)
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
11-15-2009 03:08 AM
Profile PM Web Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
RE: Make a batch file please?
I can do it in python in like 1 minute it you don't mind python rather than a batch file, or you could use a program with batch rename eg alsee or adobe bridge

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














11-15-2009 06:41 AM
Profile E-Mail PM Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
O.P. RE: Make a batch file please?
sonicsam is working on it... having some errors though.
and no, it needs to be something that runs in the background.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
11-15-2009 06:53 AM
Profile PM Web Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
RE: Make a batch file please?
It's been solved :p

YOU'RE WELCOME

This post was edited on 11-15-2009 at 07:30 AM by prashker.
11-15-2009 07:23 AM
Profile PM Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
RE: Make a batch file please?
I finished about 2 minutes after sam posted, but anyway
Python code:
import sys,os,time
year=time.localtime()[0]
month=time.localtime()[1]
date=time.localtime()[2]
hour=time.localtime()[3]
mins=time.localtime()[4]
if hour >=12 and hour<23:
 hour=hour-12
 med="pm"
else:med="am"
os.rename(sys.argv[1],"%s.%s.%s-%s.%s.%s-"%(month,date,year,hour,mins,med)+sys.argv[1])


[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














11-15-2009 10:03 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On