•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 397,837 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,583 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 498 | Replies: 11
![]() |
•
•
Join Date: Mar 2008
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
I have two questsions.
The first being is it possible in VB to have a user input information during the file setup and have that information be used in the source code, then compiled, and then used after the setup is complete?
Say I want to have the user input their name, the user does and when the setup is complete and he/she opens the end result program their name appears as the title of the form.
Question number 2.
Is it possible to have a program, recreate itself with another name? So it's sort of like a name change?
Like say I have name1 and when I click on the .exe it will copy itself and make name2 or randomly generated letters or numbers.
Any help is appreciated.
The first being is it possible in VB to have a user input information during the file setup and have that information be used in the source code, then compiled, and then used after the setup is complete?
Say I want to have the user input their name, the user does and when the setup is complete and he/she opens the end result program their name appears as the title of the form.
Question number 2.
Is it possible to have a program, recreate itself with another name? So it's sort of like a name change?
Like say I have name1 and when I click on the .exe it will copy itself and make name2 or randomly generated letters or numbers.
Any help is appreciated.
•
•
Join Date: Feb 2008
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 1
You don't need to do this at install time, try coding the application to check for the configuration at start up and ask if not found.
You have two easy choices for Q1 Store the configuration in the registry or a configuraiton file.
VB has a simple API for storing application information in the registry.
Q2. Get the path to your program (e.g. using App.Path), and copy it to the new name. (e.g. FileCopy source, dest) if FileCopy doesn't work it's because the program itself is locking the file.
Alternative are:
Dim fso As New FileSystemObject
fso.CopyFile source, dest
or try using the Windows API function CopyFile.
Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
or in VB.NET
System.IO.File.Copy
You have two easy choices for Q1 Store the configuration in the registry or a configuraiton file.
VB has a simple API for storing application information in the registry.
Q2. Get the path to your program (e.g. using App.Path), and copy it to the new name. (e.g. FileCopy source, dest) if FileCopy doesn't work it's because the program itself is locking the file.
Alternative are:
Dim fso As New FileSystemObject
fso.CopyFile source, dest
or try using the Windows API function CopyFile.
Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
or in VB.NET
System.IO.File.Copy
•
•
Join Date: Dec 2006
Location: United States
Posts: 612
Reputation:
Rep Power: 3
Solved Threads: 14
I went through what others have suggested, I think dexblack is pretty close.
First of all why would you distribute your application in the form of source code? Anyone can reuse it in that case.
Now, coming back to your question, yes both your questions are pretty much doable.
For First, you can go with storing the application settings in the config file and when the app launches it will reach from their, You can also use an encrypted registry key if you want to be in stealth mode.
For your second question, to achive the app rename feature you have to create a worker exe which will take care of this. Now, what is your criteria to rename the app? Is it one time or some other frequency?
First of all why would you distribute your application in the form of source code? Anyone can reuse it in that case.
Now, coming back to your question, yes both your questions are pretty much doable.
For First, you can go with storing the application settings in the config file and when the app launches it will reach from their, You can also use an encrypted registry key if you want to be in stealth mode.
For your second question, to achive the app rename feature you have to create a worker exe which will take care of this. Now, what is your criteria to rename the app? Is it one time or some other frequency?
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
Similar Threads
- Beginner Concept Questions (C)
- i have some questions about the math Library (C)
- Some Questions About Pascal (NOT H/W Help) (Pascal and Delphi)
- Programming FAQ - Updated 1/March/2005 (Computer Science and Software Design)
- help: string and random number generator Questions (C++)
- Compiling Question (C)
- Compiling Error? (C++)
- C++ Questions (C++)
- C++ and AI (C++)
Other Threads in the VB.NET Forum
- Previous Thread: AutoNumberNo
- Next Thread: New Starter On VB.Net


Linear Mode