computergroove

Cant create a file with the correct name

2 posts in this topic

#1 ·  Posted (edited)

Global $date = @MON & "-" & @MDAY & "-" & @YEAR
$sFile = _FileCreate(@ScriptDir & "\" & $date & " " & _NowTime() & ".txt")
$File = FileOpen($sFile,1)

Looking for the file name to be : 12-29-2015 10:38:25PM.txt The above creates 0.txt

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

That would be because : is not a usable character in file names. This works just fine:

#include <Date.au3>
#include <File.au3>

Global $date = @MON & "-" & @MDAY & "-" & @YEAR
$sFile = _FileCreate(@ScriptDir & "\" & $date & " " & @HOUR & "_" & @MIN & "_" & @SEC & ".txt")
$File = FileOpen($sFile,1)

 

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now