can anyone help me how to create or to make my program a self running and don.t not be open to run.

Dani AI

Generated

Quick, practical options for making a VB6 app “auto‑run” (answers tied to the thread)

asked for an app that “runs by itself” at boot. showed copying the EXE into the Startup folder and posted files; correctly pointed out that a Windows Service is the right solution for system‑level, pre‑logon behavior. Below are three realistic approaches (what they do, tradeoffs, and short VB6 examples you can drop into your project).

Per‑user (easy, no admin): put a shortcut in the user Startup folder. This is simple and reliable — Windows will launch the shortcut at user logon. The safest way is to create a .lnk rather than copy the EXE; that avoids accidental duplicates and makes uninstall cleaner. Example VB6 (uses WSH):

Dim wsh As Object
Set wsh = CreateObject("WScript.Shell")
Dim startup As String
startup = wsh.SpecialFolders("Startup")
Dim sc As Object
Set sc = wsh.CreateShortcut(startup & "\MyApp.lnk")
sc.TargetPath = App.Path & "\" & App.EXEName & ".exe"
sc.WorkingDirectory = App.Path
sc.Save

See the WSH shortcut API and where the Startup folder lives. (learn.microsoft.com)

Per‑user registry key (also simple): write an entry under HKCU\Software\Microsoft\Windows\CurrentVersion\Run so the program runs at logon. That keeps things out of Program Files and avoids needing elevation. Example VB6:

Dim wsh As Object
Set wsh = CreateObject("WScript.Shell")
wsh.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\MyApp", _
            Chr(34) & App.Path & "\" & App.EXEName & ".exe" & Chr(34), "REG_SZ"

Use HKCU for per‑user; HKLM requires admin and triggers UAC. (learn.microsoft.com)

System/always‑on (services or scheduled task): if the program must run before anyone logs in (real antivirus behavior) use a Windows Service (write the service component in .NET or native code), or register a scheduled task to run at system start with appropriate privileges. Example command to create a startup task:

schtasks /create /tn "MyApp" /tr "C:\Program Files\MyApp\MyApp.exe" /sc onstart /ru SYSTEM /rl HIGHEST /f

Services run before logon; scheduled tasks can run at startup with elevated rights — both require proper design and testing. (learn.microsoft.com)

Short cautions: avoid silently adding auto‑start entries on other people’s machines (AV/Windows may flag it). Test paths and quoting (spaces), prefer per‑user HKCU or shortcuts unless you really need service‑level persistence, and document/uninstall the startup registration so graders or admins know what you changed.

Recommended Answers

All 20 Replies

what do you mean by self running ?

If you are trying the program run automatically then create a windows service using .net

what do you mean by self running ?


for example a anti virus it was automatially run when u boot ur PC...
what is that command?


and what is that .net? can u help me on that aspects coz im only 16 y/o and new student

you must access registry to do this or put the program on startup program..

you must access registry to do this or put the program on startup program..

the easiest way is put the program on startup program, you can access this as special folder with vb

"the easiest way is put the program on startup program, you can access this as special folder with vb"

how can i do thaT? and i wan't to do it to the program that is a self-running and it can open with himself

try this following code to copy your program to startup program, but the program must running once to do this. there is none code to make your program running by it self without running before. just one time running and it will running by windows cause windows will running all program in startup program.

Private Sub Form_Load()
Dim mShell
Dim path As String
Set mShell = CreateObject("WScript.Shell")
path = mShell.Specialfolders("Startup")
FileCopy App.EXEName & ".exe", path & "\YourNewRunFileName.exe"
End Sub

for auto running for your program

you have use boot.ini file of window

you have to make changes in window registry


i think you have use a specific event of your progrm with timer in and out event


thanks
http://webdesigningcompany.net

try this following code to copy your program to startup program, but the program must running once to do this. there is none code to make your program running by it self without running before. just one time running and it will running by windows cause windows will running all program in startup program.

Private Sub Form_Load()
Dim mShell
Dim path As String
Set mShell = CreateObject("WScript.Shell")
path = mShell.Specialfolders("Startup")
FileCopy App.EXEName & ".exe", path & "\YourNewRunFileName.exe"
End Sub

is this for vb6?

yes, it is.

can u help to encode and make an exe of that coz i haven;t a compiler now coz the compiler is in my school plzzzzzzzzz

so copy the post, bring it to shcool then compile it.

hmmmmmmmmmmmmmm but my school day and my laboratory will be on next and i should pass it next week also can any one help me plzzzzz and can any one make an exe of that


tnx

OK.;)
This the project and exe files

Get Startup.zip

hmmmmmmmmmmmmmm but my school day and my laboratory will be on next and i should pass it next week also can any one help me plzzzzz and can any one make an exe of that


tnx
again

wow???? i already post the files...

where? plz can u make me that/

OK.
This the project and exe files
Get Startup.zip

see my post 3 days ago. i put an attachment contain file project named Get Startup.Zip

where is that?

you're very .... :ooh:

i'll post the files again. if you can see that files it's not my problem.
look for the attachment below :

Get Startup.zip

OK.

ok tnx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.