Place Time Stamp as a folder name

cmasterdc22

New member
Local time
10:40 AM
Messages
2
I create many new temporary folders every day. I am looking for a quick way to paste a time/date stamp for each new folder name. Wondering if there is a way I can link the time stamp to a windows hot key and use a paste rule?

Don't want to use excel/word/cmd prompt and copy paste over to slow.

Google turned up useless so I knew I could turn here for some assistance!

Thank you.
 

My Computer My Computer

OS
Windows 7 Professional 32 bit
You can use the %date% and %time% environment variables in a DOS prompt.

Based on this, you could edit the registry to place an Explorer context menu shortcut to a command that creates a new folder in the current directory, along the lines of mkdir "Temp created on %date% at %time%".

Unfortunately this won't be of much help - I just realized the date includes slashes "/" and the time uses colons ":", both of which are invalid characters in a file/folder name.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom-built
OS
Windows 7 Professional SP1 32-bit
CPU
Intel Core 2 Duo E6600 2.4GHz
Motherboard
Asus PL5D2
Memory
4GB DDR2-667 (4x1GB in dual-channel config)
Graphics Card(s)
nVidia GeForce 9800 GT
Sound Card
Creative X-Fi XtremeMusic
Monitor(s) Displays
Acer P236H
Screen Resolution
1920x1200 (DVI)
Hard Drives
OCZ SSD Vertex Plus 60GB SATA (Firmware 3.55), 64MB cache
Hitachi HD321KJ SATA, 320GB, 7200rpm, 16MB cache
PSU
Antec TruePower 2.0
Case
Cooler Master Centurion
Cooling
Too many fans
Keyboard
Standard
Mouse
Microsoft wireless optical mouse
Internet Speed
AT&T U-verse (18mbit/sec)
Antivirus
Microsoft Security Essentials
Browser
Firefox
Other Info
Other devices:
Compaq CQ-60 laptop
Google Nexus 7 (2012) tablet
Nvidia SHIELD tablet (US/LTE)
Hardkernel ODROID-XU single-board computer (Samsung Exynos 5420)
The following script will create a directory with the current timestamp (without the illegal characters):

Code:
@echo off
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)

set mydir="%mydate%_%mytime%"

mkdir %mydir%
Copy and paste that into something like "dirs.bat" and save it to your desktop. Then, with AHK, you could implement something like the following:

Code:
RAlt::Run C:\Documents and Settings\Username\Desktop\dirs.bat, C:\Documents and Settings\Username\Desktop

However, it will create the directory wherever the bat file is run from, in this case the Desktop. If there is a certain directory you're always creating these temp folders in, you could easily change the code to reflect that directory and place the .bat file in there.
 

My Computer My Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
Awesome! That totally gets a rep from me. +1 :)
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom-built
OS
Windows 7 Professional SP1 32-bit
CPU
Intel Core 2 Duo E6600 2.4GHz
Motherboard
Asus PL5D2
Memory
4GB DDR2-667 (4x1GB in dual-channel config)
Graphics Card(s)
nVidia GeForce 9800 GT
Sound Card
Creative X-Fi XtremeMusic
Monitor(s) Displays
Acer P236H
Screen Resolution
1920x1200 (DVI)
Hard Drives
OCZ SSD Vertex Plus 60GB SATA (Firmware 3.55), 64MB cache
Hitachi HD321KJ SATA, 320GB, 7200rpm, 16MB cache
PSU
Antec TruePower 2.0
Case
Cooler Master Centurion
Cooling
Too many fans
Keyboard
Standard
Mouse
Microsoft wireless optical mouse
Internet Speed
AT&T U-verse (18mbit/sec)
Antivirus
Microsoft Security Essentials
Browser
Firefox
Other Info
Other devices:
Compaq CQ-60 laptop
Google Nexus 7 (2012) tablet
Nvidia SHIELD tablet (US/LTE)
Hardkernel ODROID-XU single-board computer (Samsung Exynos 5420)
Thanks friends. I will try to run a set up as described above. Thanks for the quick response as well!!
 

My Computer My Computer

OS
Windows 7 Professional 32 bit
Just for further FYI with AHK, you can also run command line instructions directly from the script:

Code:
code = 
(join& 
date /t 
time /t 
) 
run %comspec% /k %code% 
return
 

My Computer My Computer

OS
XP / Win7 x64 Pro
CPU
Intel Quad-Core Q9450 @ 3.2GHz
Motherboard
Asus P5-E
Memory
2x2GB GSkill DDR2
Graphics Card(s)
NVIDIA GeForce 8600 GTS (EVGA)
Monitor(s) Displays
Dell 2408WFP
Screen Resolution
1920x1200
As this was one of the top results for timestamps in Google, I'd thought I'd add a bit more.... Other options to use: Environment Variable Substrings: ie Extracts characters so 31/03/2012 = 12-03-31, and 14:59 = 1459 echo %date:~8,2%-%date:~3,2%-%date:~0,2% echo %time:~0,2%%time:~3,2% or another for loop format: for /f "tokens=1-3 delims=/" %%a in ('echo %date%') do @echo %%c%%b%%a or Time, w/o hundredths/sec: echo %time:~0,2%%time:~3,2% Environment Variable Substitution: ie Extracts characters so 31/03/2012 = 31032012, and 14:59 = 1459 echo %date:/=% Time, (with hundredths/sec) echo %TIME::=%
 

My Computer My Computer

OS
Windows 7 Pro 64-bit
About 5 years ago, a friend of mine made a right-click context menu that did exactly this in XP. It was a real time saver! If anyone is thinking of making one, please let me know.
 

My Computer My Computer

OS
64 win 7
About 5 years ago, a friend of mine made a right-click context menu that did exactly this in XP. It was a real time saver! If anyone is thinking of making one, please let me know.

This is exactly what im looking for on Windows 10. If anyone has a solution, please do let me know. Thanks!
 

My Computer My Computer

Computer Manufacturer/Model Number
Apple iMac
OS
Windows 7 Ultimate Version 6.1 (Build 7600)
CPU
3.06GHz Intel Core i3 processor
Motherboard
iMac
Memory
4GB DDR3
Graphics Card(s)
NVIDIA GeForce 9400M (256 MB GDDR3)
Sound Card
onboard
Monitor(s) Displays
iMac 21.5 (1920 by 1080 pixels)
Hard Drives
500GB
PSU
iMac
Case
iMac
Cooling
onboard
Back
Top