CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002
    Location
    Greece
    Posts
    42

    Active windows directory (urgent)

    Hello.
    I want to set (not retrieve) the active windows directory through VB.
    Something like the "cd" dos command (but including the drive).

    My problem is that I want to use external programs that use other files.
    If for example you want to run a .bat file that has commands but oesn't have the full path for them inside, it won't run correctly.

    Thanks.
    Visit www.greekroms.net

    Greek translations of roms

  2. #2
    Join Date
    Oct 2001
    Location
    Melbourne, Australia
    Posts
    576

    Re: Active windows directory (urgent)

    ChDir for changing the directory and ChDrive for changing the drive. Check out the help for how to use them (it's pretty simple), and be aware that you cannot change drives through ChDir, you have to change the drive using ChDrive first, then change the directory.

    maybe i'm missing the point, but you might want to check out the path statement in the autoexec.bat file also. it controls default paths that are checked if a program you attempt to run in dos or batch files isn't in the current directory. this is fairly old school though.

  3. #3
    Join Date
    Apr 2002
    Location
    Greece
    Posts
    42

    Re: Active windows directory (urgent)

    Thank you Zeb, that's exactly what I wanted!
    In fact, I had used ChDrive and ChDir in the past, but I don't have the help installed, so I couldn't find them now. There weren't any posts about this either...
    Visit www.greekroms.net

    Greek translations of roms

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

Featured