Windows Scripting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationWindows Scripting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 1st, 2007, 12:52 AM
ryanlcs ryanlcs is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 156 ryanlcs User rank is Sergeant (500 - 2000 Reputation Level)ryanlcs User rank is Sergeant (500 - 2000 Reputation Level)ryanlcs User rank is Sergeant (500 - 2000 Reputation Level)ryanlcs User rank is Sergeant (500 - 2000 Reputation Level)ryanlcs User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 5 h 59 m 54 sec
Reputation Power: 20
Retrieve File's Last Modified Date

Is there a way to Retrieve File's (Excel,Word,csv) Last Modified Date??

Reply With Quote
  #2  
Old March 1st, 2007, 08:50 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,048 Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Days 12 h 32 m 33 sec
Reputation Power: 555
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
Yup. Use the FileSystemObject.

vb Code:
Original - vb Code
  1. Set objFso = CreateObject("Scripting.FileSystemObject")
  2. Set objFile = objFso.GetFile("myfile.doc")
  3. Wscript.Echo objFile.DateLastModified
GetFile accepts a single string attribute that is a full relative or absolute path to the file.
__________________
Click the image if at any point you don't like my decision.

Scripting problems? Windows questions? Ask the Windows Guru!


Reply With Quote
  #3  
Old March 1st, 2007, 07:06 PM
ryanlcs ryanlcs is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 156 ryanlcs User rank is Sergeant (500 - 2000 Reputation Level)ryanlcs User rank is Sergeant (500 - 2000 Reputation Level)ryanlcs User rank is Sergeant (500 - 2000 Reputation Level)ryanlcs User rank is Sergeant (500 - 2000 Reputation Level)ryanlcs User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 5 h 59 m 54 sec
Reputation Power: 20
Nice one. Thanks.

Reply With Quote
  #4  
Old March 1st, 2007, 07:56 PM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,048 Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Days 12 h 32 m 33 sec
Reputation Power: 555
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
No problemo.

Reply With Quote
  #5  
Old March 16th, 2007, 01:19 AM
nathanitm nathanitm is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 nathanitm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m
Reputation Power: 0
last modified date

Quote:
Originally Posted by Nilpo
Yup. Use the FileSystemObject.

vb Code:
Original - vb Code
  1. Set objFso = CreateObject("Scripting.FileSystemObject")
  2. Set objFile = objFso.GetFile("myfile.doc")
  3. Wscript.Echo objFile.DateLastModified
GetFile accepts a single string attribute that is a full relative or absolute path to the file.


I tried the above code its not working for me in vb6.0 . I tried a xls files lastmodified date . Is it possible to retrieve lastmodified date for a xml file. Please reply

Thanks & Regards,
J.Senthil Nathan

Reply With Quote
  #6  
Old March 16th, 2007, 09:23 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,048 Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Days 12 h 32 m 33 sec
Reputation Power: 555
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
Quote:
Originally Posted by nathanitm
I tried the above code its not working for me in vb6.0 . I tried a xls files lastmodified date . Is it possible to retrieve lastmodified date for a xml file. Please reply

Thanks & Regards,
J.Senthil Nathan
That's partially because that's not VB6 code. The majority of this code should work, providing you added the proper Dim statements. However, there is no Wscript object in VB6 so it would hang on the last line. We'll change that to a VB MsgBox instead. While we're at it, let's make a few small changes to accomplish this task properly. Here's the correct method of connecting to the FileSystemObject in VB6. Try this:
VB Code:
Original - VB Code
  1. Dim objFso As New FileSystemObject
  2. Dim objFile As File
  3. Dim response As Integer
  4. Set objFile = objFso.GetFile("myfile.doc")
  5. response = Msgbox(objFile.DateLastModified)

Reply With Quote
  #7  
Old August 2nd, 2007, 01:00 PM
sam76210 sam76210 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 5 sam76210 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m 8 sec
Reputation Power: 0
Retrieve File's Last Modified Date

I am new in VB script. I am saving the following code in txt file and saving in vbs format. when i ran the file i got error on line 1 char 12 which AS. Am i missing VB libray. Do i have to have VB installed on my machine?
thanks in advance for any reply
sam

Quote:
Originally Posted by Nilpo
That's partially because that's not VB6 code. The majority of this code should work, providing you added the proper Dim statements. However, there is no Wscript object in VB6 so it would hang on the last line. We'll change that to a VB MsgBox instead. While we're at it, let's make a few small changes to accomplish this task properly. Here's the correct method of connecting to the FileSystemObject in VB6. Try this:
VB Code:
Original - VB Code
  1. Dim objFso As New FileSystemObject
  2. Dim objFile As File
  3. Dim response As Integer
  4. Set objFile = objFso.GetFile("myfile.doc")
  5. response = Msgbox(objFile.DateLastModified)

Reply With Quote
  #8  
Old August 2nd, 2007, 07:41 PM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,048 Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Days 12 h 32 m 33 sec
Reputation Power: 555
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
Quote:
Originally Posted by sam76210
I am new in VB script. I am saving the following code in txt file and saving in vbs format. when i ran the file i got error on line 1 char 12 which AS. Am i missing VB libray. Do i have to have VB installed on my machine?
thanks in advance for any reply
sam
The example I posted was for VB6, in VBS there is not AS command so it has to be written slightly differently.

vb Code:
Original - vb Code
  1. Dim objFso, objFile, response
  2. Set objFso = CreateObject("Scripting.FileSystemObject")
  3. Set objFile = objFso.GetFile("myfile.doc")
  4. response = Msgbox(objFile.DateLastModified)

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationWindows Scripting > Retrieve File's Last Modified Date


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |