Visual Studio doesn't care where your project files are. You can literally put them anywhere.
A word of warning however about putting files on the desktop. In general I would strongly recommend doing this or storing files directly on the desktop. If you do that then every time the desktop is shown (which is all the time) AV has to run to scan the files. The more files you put on the desktop the longer it takes to scan and the slower the desktop responds. If you absolutely must put something on the desktop then store it elsewhere and put a shortcut on the desktop. From a usability point of view you cannot tell the difference but a very small file is faster to scan than the full file.
I'm also going to say that it sounds like you just want to have quick access to a project. VS already has the Start Window for this so I don't really see any benefit in putting any projects on the desktop (even shortcuts). Additionally VS supports jump lists so recent solutions are accessible directly from the VS icon on your taskbar if needed. So, in general, I wouldn't recommend you store your projects on the desktop at all but, worse case, use a shortcut to the solution folder instead.
Now back to your problem. Provided VS was properly installed you can put your solution folder anywhere. Open VS and open the solution, then do a build. The location of your project doesn't impact the build system finding things that ship as part of the build system. If you are attempting to build from the command line then ensure you are using the Developer Command Prompt that is part of the VS start menu folder. This sets the paths to the build system properly. Again, the path to your project is completely irrelevant. Change to your solution's directory and msbuild
and it will build.
Just to be clear though, you need to have a solution and project to do this. If you're simply trying to open a source file and "debug" it then things aren't going to work out as well and that has nothing to do with folder paths.