Click here to Skip to main content
11,490,801 members (69,309 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi,

Part of the console program i'm doing is extraction of a zip file, and in extracting the zip file, a popup dialog box appears. The program run on scheduled task, meaning there will be human intervation(clicking of buttons). So i so browsed to see what to do to remove the popups.


I found one thats makes me create a subkey in the registry. By default, the created subkey will have:
Name Type Data
(Default) REG_SZ (Value Not Set)

What I need to do is to replace the data with 0(zero). How can i do this ?

I'm doing the changes in registry programmatically. If the subkey exists, then i don't need to enter the registry and continue with the process.

Please Help me.
Posted 21-Jan-13 15:10pm
Comments
Sergey Alexandrovich Kryukov at 21-Jan-13 20:22pm
   
Which part of MSDN help was a problem to understand?
—SA
PIEBALDconsult at 21-Jan-13 20:51pm
   
None of that is a good idea. Please rethink.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This is how: http://msdn.microsoft.com/en-us/library/5a5t63w8.aspx[^].

Don't forget that you want to overwrite the {Default} value. Second parameter should be either null or string.Empty, which represents {Default}, and third — zero. This is explained in the first "Note" section referenced above.

—SA
  Permalink  
Comments
Alan Tuscano at 22-Jan-13 21:25pm
   
Hi SA,
I've done the code and run it.

regKey1.SetValue("", "", 0)

But in the registry, the value for default becomes empty/no value.
Sergey Alexandrovich Kryukov at 22-Jan-13 21:38pm
   
How could it work with both empty string parameters, in principle?! Look thoroughly, only the second parameter is empty. And you yourself a favor, never write "", use string.Empty (or null, in this case).
—SA
Alan Tuscano at 7-Feb-13 1:05am
   
Thanks SA..
Sergey Alexandrovich Kryukov at 7-Feb-13 1:23am
   
You are welcome.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 476
1 Andy Lanng 288
2 Sascha Lefèvre 240
3 OriginalGriff 178
4 Maciej Los 160
0 Sergey Alexandrovich Kryukov 9,713
1 OriginalGriff 8,475
2 Sascha Lefèvre 3,544
3 Maciej Los 3,106
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100