tags:

views:

150

answers:

4

How do I save an entire VB6 project to a new folder? Modules and all. I'm in a position where I need to work with some old VB6 projects. I'd like to save them to a new folder but when I save the project, all that is saved is the vbp file. No modules, no frm files. I want to be able to save all the info to a single folder without moving each BAS file one at a time. Is this even possible?

Addition: The first 2 replies make good sense. But my problem is that the BAS modules seem to be scattered all over the place. Making Windows Explorer do the work a bit tricky. If I have to I will but was looking for an easier way.

Thanks

+2  A: 

If you mean from within Visual Studio, I don't think you can except by doing Save As for each file...

But the simpler approach is to just use Windows Explorer and copy the whole folder structure for the solution into another folder, (or do a recursive "Get" from your source code repository to a different local destination), and then open the solution or project file in the new location... The pointers in the project file that tell Visual Studio where 5all the individual source code and other files are located are generally all stored as relative paths, relative to the folder that the project file is in...

Charles Bretana
All good answers but this is the technique I used. Thanks everyone
JimDel
+1  A: 

It's been a while since I used VB6, but I'd be tempted to move them using Windows Explorer, then manually edit the VBP file to point to the new locations afterwards. If I remember right, relative paths are fine in the VBP, so you may not even need to manke any changes.

Xav
+1  A: 
  1. Unbind from source control, if capable/appropriate.
  2. Check into source control as a brand new solution/project
  3. Recursive 'get' from your SCM into a new directory.
  4. There's your new copy.
p.campbell
+2  A: 

Given the new "addition" to the question:

  1. Move the VBP and the files in Windows Explorer to a completely new directory.
  2. Open the VBP in a text editor and change any absolute paths to relative paths. VBP files are simple text files, and the format is even documented in the VB6 manual.

Here's an example. This evil VBP below has many absolute paths

Type=Exe 
Form=c:\who\knows\where\B_Form.frm 
Module=CModule; z:\magic\mapped\network\drive\heehee\C_Module.bas 
Class=DClass; x:\personal\usb\stick\D_Class.cls

It would be changed to this benign VBP, which references local copies of the files. You can use relative paths for subdirectories.

Type=Exe 
Form=B_Form.frm 
Module=CModule; C_Module.bas 
Class=DClass; subdirectory\D_Class.cls
MarkJ