I am new to coding in vb.net and I am trying to add a registry value in
the runonce key. The key is added correctly, as I can see it when
going directly into the registry after executing my code, but when I
reboot, the value (aka the .cmd file) is not executed and the string
value is not deleted from the registry (at
HKLM\Software\Microsoft\Windows\CurrentVersion\Run Once).
Here is the code I am using to create the key:
Dim key As Microsoft.Win32.RegistryKey =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(" SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" ,
True)
key.SetValue("MWAClean", "c:\sma\mwaclean\mwaclean.cmd")
Is there something wrong with the code I'm using to create the key that
is not allowing XP to see it on startup...or is there something else
going on here with windows????
Any help will be greatly appreciated,
Luke 3 7127
Try putting the execution of the .cmd in a .bat file and add that to the
registry RunOnce.
That way you can debug the batch file when the system reboots by using echo
commands.
<lu********@gmail.comwrote in message
news:11*********************@73g2000cwn.googlegrou ps.com...
>I am new to coding in vb.net and I am trying to add a registry value in
the runonce key. The key is added correctly, as I can see it when
going directly into the registry after executing my code, but when I
reboot, the value (aka the .cmd file) is not executed and the string
value is not deleted from the registry (at
HKLM\Software\Microsoft\Windows\CurrentVersion\Run Once).
Here is the code I am using to create the key:
Dim key As Microsoft.Win32.RegistryKey =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(" SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" ,
True)
key.SetValue("MWAClean", "c:\sma\mwaclean\mwaclean.cmd")
Is there something wrong with the code I'm using to create the key that
is not allowing XP to see it on startup...or is there something else
going on here with windows????
Any help will be greatly appreciated,
Luke
I have it on good authority that <lu********@gmail.comsaid in
news:11*********************@73g2000cwn.googlegrou ps.com...
>I am new to coding in vb.net and I am trying to add a registry value in
the runonce key. The key is added correctly, as I can see it when
going directly into the registry after executing my code, but when I
reboot, the value (aka the .cmd file) is not executed and the string
value is not deleted from the registry (at
HKLM\Software\Microsoft\Windows\CurrentVersion\Run Once).
Here is the code I am using to create the key:
Dim key As Microsoft.Win32.RegistryKey =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(" SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" ,
True)
key.SetValue("MWAClean", "c:\sma\mwaclean\mwaclean.cmd")
Is there something wrong with the code I'm using to create the key that
is not allowing XP to see it on startup...or is there something else
going on here with windows????
Any help will be greatly appreciated,
Luke
You've pretty much established that your vb.net code is ok.
You may need to include a link to cmd.exe or %comspec% to precede your
command string.
--
Jon
Debugging got me going in the right direction...just an error in the
batch file.
Thanks for your help
NewScience wrote:
Try putting the execution of the .cmd in a .bat file and add that to the
registry RunOnce.
That way you can debug the batch file when the system reboots by using echo
commands. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Yoni Gibbs |
last post by:
Hi,
Once an assembly has been downloaded into the GAC, is it possible to
execute it locally somehow? e.g. if I download an exe into the GAC,
can the client PC simply run this assembly directly,...
|
by: Dmitri Shvetsov |
last post by:
Hi,
My C# application works under administrative account but can't write to:
HKML\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
What can I do to write there?
Dmitri
|
by: Chakkaradeep |
last post by:
Hi all,
i have written a Service,now i want to execute another application (for
eg;calc.exe) in the service....how will i perform it??...
i tried using this....
/**************Executing a...
|
by: Anthony Nystrom |
last post by:
I need to exceute a method in a form from another form... Both forms will always be open so I don't have to worry about that... I just need to call the method... Please help... Source please...
|
by: Bruceneedshelp |
last post by:
My application starts logging and executes shell commands on startup. The
application runs fine, except when it executes at boot time. In other words
when I make it a "startup" application on my...
|
by: Pete Vickers [MVP] |
last post by:
Hi,
I have a project, that doesn't appear to process frmMain at all - I break at
form_load, and nothing happens. The form shows, but has done no processing
in the form load.
I have tried having...
|
by: lovecreatesbea... |
last post by:
K&R 2, sec 2.4 says: If the variable in question is not automatic, the
initialization is done once only, conceptually before the program
starts executing, ... .
"Non-automatic variables are...
|
by: IanB |
last post by:
I've just installed IE7 as part of Windows Update on this computer (Compaq
AMD64X2 4200+ 2Gb) but it will not run the opening link:
http://runonce.msn.com/runonce2.aspx
just leaving me with a...
|
by: amolbehl |
last post by:
Hi,
I have a written 2 VB programs, "startup.exe" and a "mainProgram.vbp" now I need to invoke the "startup.exe" via mainProgram.vbp and send a parameter to the startup.exe as well.
Does...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
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...
|
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...
| |