I am pretty new to Visual Basic, I will be going to programming school soon. As for now, I don't know really anything. Now to my question. I have a couple files I want to install into the C:/ directory. They're all put into a folder. I typed in this to my 'install' button.

My.Computer.FileSystem.MoveDirectory("source/zevoxa", "C:\")

Now, when I run my program, click install it says it "cannot find source/zevoxa". I added the source folder manually. Should I have not done that? The source folder I created is located in

C:\Users\Zevoxa\Documents\Visual Studio 2012\Projects\Zevoxa Program\Zevoxa Program\bin\Release

Thanks in advance.

3 Years
Discussion Span
Last Post by Zevoxa


I have a couple of comments and suggestions that I hope will help you. These are mainly to get you thinking in terms of what information you need to provide for the application to work.

  1. If you are planning on using this program more than once then you should be copying the directory rather than moving it. If you move it it will not be available for future use.
  2. When moving or copying files in an application you have to consider where the application is and where it will be run from. You either have to give the application the absolute path to files you want to move or be positive of where you are when you run the application. If I am understanding you correctly the directory you wan t to move is in:

    C:\Users\Zevoxa\Documents\Visual Studio 2012\Projects\Zevoxa Program\Zevoxa Program\bin\Release

and would have the absolute path of:

C:\Users\Zevoxa\Documents\Visual Studio 2012\Projects\Zevoxa Program\Zevoxa Program\bin\Release\source\zevoxa

For the code you provided to be able to work it would have to be run by your user from the Release directory in order to properly movew the file.

  1. If you are just wanting to create a new directory then you use a different command. Use the CreateDirectory method by specifying the full path of the location where the directory should be created. This example creates the directory NewDirectory in C:\Documents and Settings\All Users\Documents.

    My.Computer.FileSystem.CreateDirectory _
    ("C:\Documents and Settings\All Users\Documents\NewDirectory")

Hope this helps and good luck as you learn more about programming.


Thank you for your reply, rch1231. That somewhat helped me, but I'm not wanting to move the directory. I'm wanting a way to where, when people download my program, it will install the contents I have in source/zevoxa. How would I do this?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.