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

  • Home
  • SEARCH
  • 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 7987401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:08:17+00:00 2026-06-04T12:08:17+00:00

im trying to make a vbscript that would list all contents in dir and

  • 0

im trying to make a vbscript that would list all contents in dir and read through each file extracting the data to manipulate and run a powershell script using this data as arguments. i found the following to start off with but it does not work. can somebody help?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    ' make a reference to a directory
    Dim di As New IO.DirectoryInfo("c:\")
    Dim diar1 As IO.FileInfo() = di.GetFiles()
    Dim dra As IO.FileInfo

    'list the names of all files in the specified directory
    For Each dra In diar1
        ListBox1.Items.Add(dra)
    Next
End Sub
  • 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-04T12:08:19+00:00Added an answer on June 4, 2026 at 12:08 pm

    VBScript was very similar to VB, but it was a long time since I used VB last time…

    AFAIR ListBox1.Items.Add() expects and Item or a string as a parameter, NOT a FileInfo object
    Try to use
    ListBox1.Items.Add(FileInfo.FullName)

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

Sidebar

Related Questions

Trying to make a custom :confirm message for a rails form that returns data
I'm trying to make a small VBScript that compacts a MS Access 2007 database
Trying to make a toggle button that hides/shows the right window/pane. Here is a
trying to make an iPhone app and going through the tutorials and books recommended
Trying to make simple jQuery function to create a scrollToTop button that fades in
Trying to make infoWindows a little less uglier I found out that the infoWindows
Trying to make a generic PL/SQL procedure to export data in specific XML format,
trying to make one horizontal box.. inside that update limits. if u see the
Trying to make a regex that can handle input like either: Beverly Hills, CA
Trying to make a simple scroll to top button that smoothly scrolls up and

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.