473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

StartUp coding problem

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
Dim regKey As New Object

Dim strKeyValueHere As String
Dim strMyExePathAndName As String
Const strKeyRootPath As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run \"
Const HKEY_LOCAL_MACHINE As Long = &H80000002
strKeyValueHere = "MyKey"
strMyExePathAndName = App.Path & "\FYP.Exe"
If CheckBox1.Checked = True Then

If Not regKey.GetKeyValue(HKEY_LOCAL_MACHINE, strKeyRootPath, strKeyValueHere, strMyExePathAndName) Then
regKey.UpdateKey(HKEY_LOCAL_MACHINE, strKeyRootPath, strKeyValueHere, strMyExePathAndName)
End If
End If
End Sub
above is my own startup coding. however it got some error about the "Name App is not declared". Is there someone can help me solve the problem?
Apr 6 '08 #1
1 798
balabaster
797 Expert 512MB
strMyExePathAndName = App.Path & "\FYP.Exe"
Try:
strMyExePathAndName = Application.StartupPath & "\FYP.exe"

Or

strMyExePathAndName = System.Environment.CurrentDirectory & "\FYP.exe"

One or both of those should do the trick for you...
Apr 6 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Duane Winner | last post by:
Hello all - I'm having a small problem with the mysql startup script that ships with MySQL-3.23.56-1. I'm running on RedHat Linux. It works fine, but I have a backup server that runs a script...
2
by: Alex | last post by:
Dear all, I am now creating a website which have 3 languages (English, Simplified Chinese and Traditional Chinese). The server has installed English version Window 2000 (Server Version, Default...
8
by: John | last post by:
Hi, I'm using mysql-server-3.23.58-4 on a Linux (Fedora 1) machine. After reading the security section of the manual from http://dev.mysql.com, I added passwords for the 'root' accounts. ...
1
by: Iulian Ionescu | last post by:
Here is my problem. I have a project MyWeb, but I created this project directly in the root, so you have c:\inetpub\wwwroot\MyWeb.sl and the default page is c:\inetpub\wwwroot\default.aspx,...
2
by: bill yeager | last post by:
I'm registering a startup script in my "page load" event. Everything works fine when I run it locally, but when it's deployed to the webserver, it doesn't execute the javascript which is inside a...
1
by: PraveenKadkol | last post by:
Hi, I have removed all the check box from startup menu for my MsAccess application, Earlier it was working fine with my old system, when i moved to new system, even holding Shift is not working...
0
by: Jack Russell | last post by:
I just converted my project from Vb.net 2003 to express 2005 I get the following message frmmain is a type in 'TCW3' and cannot be used as an expression. File is TCW3MainForm.vb line 0 column...
2
shek124
by: shek124 | last post by:
I want to run a windows startup program. here my code: Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal Hkey As Long) As Long Public Declare Function RegCreateKey Lib...
3
by: gaurim | last post by:
I am facing the coding proble in the following Stored Procedure wherein I am trying to create a table after deleting it. and then I am trying to insert records from two other tables based on certain...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.