Hi all....
i m already got startup path and now i want to copying my exe file into startup.
how i can do this??
please help me. any help will be appreciated

Dani AI

Generated

A concise recap and practical notes that extend the thread: the approach shown by — copying the running executable into the Startup folder — successfully solved ’s question. For others arriving later, a few important implementation details and safer alternatives help avoid common pitfalls and make the behavior reliable across Windows versions.

Per‑user startup lives under %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup; the all‑users Startup is under %ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup (older Windows used the Documents and Settings locations). It is generally preferable to place a shortcut (.lnk) into the Startup folder or register a Run value under HKCU\Software\Microsoft\Windows\CurrentVersion\Run rather than duplicating the EXE. Writing into the all‑users locations normally requires elevated rights, so installer‑time registration is the correct pattern for system‑wide autorun.

Practical cautions and troubleshooting: the destination folder must exist and be writable; path building should use OS path utilities (not string concatenation) to avoid separator bugs. Overwriting the currently running executable is unreliable — updates should copy to a temp file and replace after logon or via a small launcher helper. Antivirus/SmartScreen can block or flag programs that self‑install into Startup, so present installer consent and clear provenance. If copying seems to silently fail, check permissions, antivirus logs, and whether the process holds a lock on the source or target file.

Security and best practice: avoid stealth persistence that resembles malware. Prefer installer or Task Scheduler "At logon" tasks for robust behavior, digitally sign installers where possible, and document any autorun changes during setup. These steps make the simple copy-to-startup approach shown in the replies a safer, more maintainable solution.

Recommended Answers

All 6 Replies

can you explain further what you want to do...

txtStartUp is path of startup folder
YourExeNameOnStartUpFolder.exe is your exe file name when it copied into startup folder.
put this following code into your current event :

FileCopy App.EXEName & ".exe", txtStartupPath & "\YourExeNameOnStartUpFolder.exe"
msgbox "Copying Success"

Hope this helps...

commented: nice one +1
commented: always help with great code :) +1
commented: Good +1

yes, got it. thank you very much.....
your help always great :)

you're welcome friend.
i m glad to help and share my knowledge :D

nice one..

thx estella...
hope it helps you :)

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.