Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
Append current Hour to saved file name
Logged in as: Guest
arrSession:exec spGetSession 2,2,64748
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> Append current Hour to saved file name
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
Append current Hour to saved file name -
10/2/2008 12:20:45 PM
kriemer
Posts: 29
Score: 0
Joined: 9/26/2008
Status:
offline
I am trying to modify code to append the current hour to the file being saved; such that the file is named temp 9.csv
I have found some code which I have append but of course with no success. Hopefully someone can see where I have gone wrong.
Set fso = CreateObject("Scripting.FileSystemObject") Set s = fso.OpenTextFile("c:\total.aqd", 1, True) NewText = Replace(s.ReadAll, """", "") s.Close '----save the text in a new file----- Dim dtmNow : dtmNow = Now Dim nTmp nTmp = (Hour(dtmNow)) Set objOutputFile = fso.CreateTextFile("c:\temp & " " & ( nTmp ).csv", True) objOutputFile.Write NewText objOutputFile.Close
Thanks in advance
k
Post #: 1
RE: Append current Hour to saved file name -
10/2/2008 1:09:58 PM
dm_4ever
Posts: 2669
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status:
offline
try....
Set objOutputFile = fso.CreateTextFile("c:\temp" & " " & nTmp & ".csv", True)
_____________________________
dm_4ever
My philosophy:
K.I.S.S - Keep It Simple Stupid
Read Me:
http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff:
http://www.visualbasicscript.com/m_47117/tm.htm
(in reply to
kriemer
)
Post #: 2
RE: Append current Hour to saved file name -
10/2/2008 1:50:13 PM
kriemer
Posts: 29
Score: 0
Joined: 9/26/2008
Status:
offline
Works a treat!
Thanks
K
I was close (but close only counts in horseshoes).
(in reply to
dm_4ever
)
Post #: 3
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> Append current Hour to saved file name
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI