views:

39

answers:

2

Hello guys,

I need to know how to make a software in Visual Studio(VC++ or VB) that can be run from a USB pendrive?

Is there anyway i can create this standalone software that doesnt need any installation in the PC in which the USB is plugged into?

+1  A: 

Just save the executable on the drive. All referenced dlls also need to be stored there. If you have code access active you also need to make sure that the drive is allowed to provide executable code.

One more thought: If the system is linux ore mac then you should consder to switch to Java to be platform independend.

schoetbi
But the system on which the software is running wont be having the visual studio or any type of IDE/compiler installed. So will it work?
White dragon
Yes. You compile your code into an executable file (.exe). If the system that you are plugging the pen-drive into is a Windows system, it can run that natively. If you have required run-time libraries, you will need to include them on the pen-drive too as Schoetbi said. If you are unsure about compiling in Visual Studio, [here](http://cplus.about.com/od/learning1/ss/clessonone.htm) is a random tutorial from google "Visual C++ compiling tutorial".
Stephen
Only the runtime dlls needs to be referenced and those are found if they are in the same folder as the exe.
schoetbi
Thanks for the correction Schoetbi!
Stephen
A: 

Yes, any native code application can run from a pen drive (so long as any dll's or associated files are also stored with it). .NET apps can also run... if the machine has the necessary run times installed.

GrandmasterB
Can you kindly brief me on what you meant by 'Run timess'?
White dragon
It's the .NET framework. This only is necessary for .NET apps- this isn't C++ for the majority of cases.
DeadMG