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 5842239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:59:30+00:00 2026-05-22T11:59:30+00:00

I am assuming there is a way to have this sub in? I am

  • 0

I am assuming there is a way to have this sub in? I am assuming Do Until Loop is the way to go, I just do not know how to contruct one.

    Sub Main()
    'Declare Command
    Dim sCommand As String
    'Declare File where Users are Located
    Dim strFile As String = "C:\TestDUsers.txt"
    'Running from Admin Comptuer so permissions are fine
    'Want to replace the ******** section with each username from text file
    sCommand = "pushd \\*********\C$ && whoami.exe >> C:\File.txt"

    'Load the File and perform the loop????

    Using sr As New StreamReader(File.Open(strFile, FileMode.Open))

    End Using

    Console.WriteLine()
    Console.Clear()

    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-05-22T11:59:30+00:00Added an answer on May 22, 2026 at 11:59 am

    Something like this if I understand your question correct:

    Sub Main()
        HandleJavaInfo()
    End Sub
    
    Sub HandleJavaInfo()
        Dim strFile As String = "C:\Users\pseal2\Desktop\TestDUsers.txt"
        Dim strCommand = "pushd \\*********\C$ && whoami.exe >> C:\Users\pseal2\Desktop\Javainfo."
    
        Dim strLines() As String = IO.File.ReadAllLines(strFile)
        For Each strUserName As String In strLines
    
            'execute the command as shell or process
    
            'Example using Shell (run the command whitout showing the window for the user)
            Dim ThisCommand As String = strCommand.Replace("*********", strUserName)
            Shell(ThisCommand, AppWinStyle.Hide)
    
            'Example using process
            Process.Start("pushd", "\\" & strUserName & "\C$ && whoami.exe >> C:\Users\pseal2\Desktop\Javainfo.")
    
        Next
    End Sub
    

    Now, you have only told us what you want to DO, not what you want to achieve. If you tell us exactly what the goal is, then it may be some other .Net ways to do what you want, instead of shelling out to a DOS-command, and you can get more accurate answers.

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

Sidebar

Related Questions

Is there a cleaner way to do the following, assuming that I have a
Are there any way to access or set iphone's alarm? Im assuming if this
Is there a way to know if TAdoQuery in Edit state was changed? Assuming
Is there any way to achieve a += operator within the css operator (assuming
I have the following situation. Assuming there are 3 systems: A,B,C and A is
I'm currently estimating a new project. My high level estimate assuming there was one
I have this line of code: $('#sitesAccordion .groupOfSites').click(function() { var lastOpenSite = $(this).siblings().hasClass(':not(.closedTab)'); console.log(lastOpenSite);
Assuming I have this function: Func<string> fs = () => test; var st =
assuming we have this regex: preg_match('/\b(xbox|xbox360|360|pc|ps3|wii)\b/i' , $string, $matches); now, whenever the regex match
Assuming I have the following delegate public delegate void ControlInitializer(Control control); Is there a

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.