Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8219993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:22:01+00:00 2026-06-07T13:22:01+00:00

Hi I cant get the below script ive worked on to pickup the extension

  • 0

Hi I cant get the below script ive worked on to pickup the extension of the files, Can any help me out by pointing where I have gone wrong?

dim fileSystem, folder, file 
dim path
dim count : count = 0
path = "C:\temp" 

Set fileSystem = CreateObject("Scripting.FileSystemObject") 
Set folder = fileSystem.GetFolder(path)

for each file in folder.Files     
    if file.DateLastModified > dateadd("h", -24, Now) & File.name = "txt" then 

count = count + 1

end if
Next

if count < 4 then

Set WshShell = WScript.CreateObject("WScript.Shell")
strcommand = "eventcreate /T ERROR /ID 666 /L Application /SO BESROffsite /D " & _  
Chr(34) & count & " Files found please check offsite copy " & Chr(34)  
WshShell.Run strcommand
wScript.Quit ( 1001 )

Else

Set WshShell = WScript.CreateObject("WScript.Shell")
strcommand = "eventcreate /T Information /ID 666 /L Application /SO BESROffsite /D " & _  
Chr(34) & count & " Files found offsite is working fine " & Chr(34)  
WshShell.Run strcommand
wScript.Quit ( 0 )
End if
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T13:22:06+00:00Added an answer on June 7, 2026 at 1:22 pm

    File.name is the full name including the extension, to test for the extension;

    if ... fileSystem.getExtensionName(file.name) = "txt" then
    

    You also want the logical And not the bitwise concatenating & in their too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying everything I can to get this script to work and
I have a problem returning a variable in my function, the below script works
I can't get the jquery selector in my javascript below to work in Safari
I've written the Perl script below which generates a warning and I can't work
I've been trying the below script (within a larger app I'm working on) for
I've spent a while on this but can't get this to work, I apologize
I wonder whether someone can help me please. I'm trying to implement the mysql_insert_id()
i have a youtube embedded channel from a certain company, and below i have
I can't seem to get the nose testing framework to recognize modules beneath my
Sorry but I can't seem to get my special-kid helmet off today. I'm attempting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.