can any one help how can i create a self-runing program?? it is like a anti-virus that run when ur booting ur PC

Dani AI

Generated

Short answer: there are four practical ways to make a Windows app start automatically — put a shortcut in the Startup folder, add a Run/RunOnce registry value, create a scheduled task (Task Scheduler), or implement a Windows Service. Several replies here already pointed to the first two options (thanks and ); those are fine for simple user-level autostart. For an antivirus-style, always-on background process you should build a proper Windows Service instead — services run before logon and are the supported pattern for system-level tools. (learn.microsoft.com)

Practical notes and quick examples:

  • Startup folder (per-user): open Run → type shell:startup and drop a shortcut there. System-wide startup goes in the common startup folder (shell:common startup). Changes here are simple and reversible. (support.microsoft.com)

  • Run registry keys (per-user or machine): the Run keys under HKCU/HKLM will execute at logon; HKLM requires admin and affects all users. Use the registry only when you understand permissions and quoting rules. (learn.microsoft.com)

  • Task Scheduler (recommended if you want triggers, elevated run, or “run at boot” semantics): you can create a scheduled task to run at logon or at system startup and choose “run with highest privileges.” Example (PowerShell):

    $action = New-ScheduledTaskAction -Execute 'C:\Program Files\MyApp\MyApp.exe'
    $trigger = New-ScheduledTaskTrigger -AtLogOn
    Register-ScheduledTask -TaskName 'MyAppStartup' -Action $action -Trigger $trigger -RunLevel Highest

    Use Task Scheduler when you need control over credentials, elevation, or retries. (man.hubwiz.com)

Stopping or debugging an autostarting app: remove the shortcut, delete the Run value, disable the scheduled task, stop/uninstall the service, or use Microsoft Sysinternals Autoruns to find every persistence location and disable it. Check Task Manager → Startup and Event Viewer for errors. (support.microsoft.com)

Important security/legal note: modern Windows has intentionally limited USB/CD autorun behavior to reduce malware spread — autorun for removable USB media is not a reliable way to auto-execute software and Microsoft recommends not using AutoRun to distribute applications. Do not create code that copies itself or executes on other people’s machines without explicit permission; that is malware and illegal. If the goal is a legitimate portable installer, provide a clear user-run executable or an installer that the user can run manually. (microsoft.com)

If clarification is wanted for a specific approach (VB.NET service vs. registry vs. scheduled task), say which OS you target and whether you need the app to run before any user logs on — that determines the right pattern.

Recommended Answers

All 14 Replies

you must make a file in registry to run the program or put the program file on startup program

you must make a file in registry to run the program

how can i do that can u teach me how? tnx

Take registry backup and try this.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        My.Computer.Registry.SetValue _ 
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run",  _
"MyProgram", "dir:\path\name.exe", _
Microsoft.Win32.RegistryValueKind.String)
End Sub

Alternatively you can add your program executable to startup.

hmm, cyberwizmj already answer the question. the easiest way is put the program in startup.
just give the feedback.

ok

how can i stop that program??? and i want to do is to tranfer a program to my flash disk to my computer that i will not open that file and paste to computer but instead it will enter to computer when is insert it and plug it out

so you want to make some program like virus or you really want to make virus program??
you mean when you connect your flash disk to computer the current program will running from your flash disk and infect the destination pc (copy it self to destination pc). right or not?
if u want to do this u will using autorun file (.inf) to run the program which your flash disk connect to computer.

i don't want to make a virus and infect the computer instead i just want to run it faster and not to copy and paste it just autrun it... and can i i have a sample of auto run file and it's code and i don't really do that as a vandalism instead do it as a good one

actually your current question is you want to make the program run by it self. the answer is put the program in startup or make a file on registry to run the program. now you post the other question to run your program from usb/flash disk and the answer is make the autorun file (.inf) to run the program automatically. your program like a virus behavior.

ok can u help me how to make a auto run file (.inf) and or just teach me how and what language i should use?

ok can u help me how to make a auto run file (.inf) and or just teach me how and what language i should use???????????

not language needed to make this file just write the some script on notepad and save as .inf extension. there are on your other post (vb 6) someone was giving a sample autorun file.

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.