Results 1 to 10 of 10

Thread: Set Directory VB .net 2022

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2021
    Posts
    26

    Set Directory VB .net 2022

    I need to be sure that a project is set to the correct drive and directory before a sub program continues to run.

    I've used GetCurrentDirectory() to see if I am already there and then SetCurrentDirectory() to change it if not.

    Code:
    If(Directory.GetCurrentDirectory() <> "J:" Then
    Directory.SetCurrentDirectory("J:")
    End if
    That Didn't work, I also tried Just

    Code:
    Directory.SetCurrentDirectory(J:")
    to just set the directory in case it wasn't already set.
    Also didn't work.

    I've been programming for over 50 years, at least the past 10-12 in Visual Basic, one version or another, and I cannot remember how to do this (79 years old, the mind is not as sharp). No matter where I look, I cannot find the answer. PLEASE HELP!!!!
    Last edited by Darby; Dec 27th, 2022 at 04:05 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width