|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
vb.net - RunOnce key not executing at startupthe 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\RunOnce). 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 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. <lukecoo***@gmail.com> wrote in message Show quoteHide quote news:1166044919.450526.52610@73g2000cwn.googlegroups.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\RunOnce). > 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 > Debugging got me going in the right direction...just an error in the
batch file. Thanks for your help NewScience wrote: Show quoteHide quote > 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. > I have it on good authority that <lukecoo***@gmail.com> said in
Show quoteHide quote news:1166044919.450526.52610@73g2000cwn.googlegroups.com... You've pretty much established that your vb.net code is ok.>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\RunOnce). > 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 may need to include a link to cmd.exe or %comspec% to precede your command string. -- Jon
System.Threading.Timer does not tick
There is already an open DataReader associated with this Connection which must be closed first Q: DataColumn Expressions What is WebBrowser control called now? The below snippet does not work...anyone know how to reference a procedure? Form1.closing in VB2005??? Datagrid problem Q: DataView with Table with large number of rows Getting an Object Properties value... how can I reference this bitmap????????? |
|||||||||||||||||||||||