Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Can't create a file with current date

$
0
0

For the life of me I can't seem to get the current date + time + log.txt to work when I try to create a file..

I just want the created file to be named "mm/dd/yyyy-hr:mm:seconds-log.txt

This is my code:

$_filename = @MON & "/" & @MDAY & "/" & @YEAR & "-" & @HOUR & ":" & @MIN & ":" & @SEC & "-log.txt" ;MsgBox(1, "date", $_filename) $_file = FileOpen($_filename, 2) If $_file == -1 Then     MsgBox(4096, "Critical Error", "Couldn't Create Log File!")     exit Endif

I first tried _Now() and _NowDate() and _NowTime(), They all set the variable to the date and time + log.txt but when I try to create the file it throws the error msg EVERYTIME!!!

 

 

Where is my error?

 

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>