|
So it is. My bad - please attribute it to cranial-rectal inversion.
The scripts are simple enough. It's just some WMI work. You can't translate the scripts to VB.NET code? All you need is the System.Management namespace classes to do this. Do a search to retrieve the Win32_WindowsProductActivation objects. Then iterate over the returned collection and Invoke the SetProductKey method on each instance.
The catch is you have to determine which version of Windows your running under and change between two different methods of changing the key. XP is different than XP SP1 and above.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Ok, thank you for the reply, I will see what I can do about this, I am still beginning VB so sorry for my lack of knowledge in this matter, I am the type of person who likes to get is hands dirty.
|
|
|
|
|
If you check out the documentation on the System.Management namespace, you'll find a ton of examples for searching and executing methods in WMI.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Dave Kreskowiak wrote: cranial-rectal inversion.
LMAO! Must remember that one.
|
|
|
|
|
I've had that one around for at least 10 years!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Is it possible in VB.NET to change the active scripting settings between enabled and disabled? (Tools>Options>security>custom level is where it can be found manualy)
If not, can the internet settings window be opened (without opening internet explorer)?
Thanks
|
|
|
|
|
It's possible to do, but most assuredly not easy to do or understand. It involves a bunch of COM interop work that, frankly, is not going to be easy to understand or explain. Examples are just about non-existant. This would be a large trial-and-error project.
It's possible to luanch the Internet Settings control panel using the Process class. The command line would look something like this:
rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl
displays Internet Properties, General Tab
rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,0
displays Internet Properties, General Tab
rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,1
rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,2
.
.
.
Basically, the number at the end displays one of the tabs in the control panel.
-- modified at 16:52 Wednesday 18th April, 2007
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
If a visual basic project is created in visual studio 2005 professional can it be modified in the standard version?
|
|
|
|
|
If a visual basic project is created in visual studio 2005 professional can it be modified in the standard version?
|
|
|
|
|
Yes.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
It also depends on what the app is written for. For example, Office development isn't supported on the Standard Edition. Read more of the differences here[^].
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
Hello to everyone!
I have a problem about changing the properties of an object in a Class module. Before in Visual Basic 6 i used this code to change the properties a control
Form1.Label1.Caption="...."
Then how about VB.Net?
Please help me...
Mark Angelus V. Movida
3rd yr. BSCS
St. Dominic Savio College
|
|
|
|
|
Never used vb6, but I believe 'caption' has been replaced with '.text'?
so... form1.label1.text = "...."
|
|
|
|
|
Hello!
Im trying to follow your code but! Theres no object appeared in the pop-up menu. I think theres only two (2) choices: (1) ActiveForm and (2) ControlCollection. But I don't know how to use that two properties.
Thank you for helping me!
Mark Angelus V. Movida
3rd yr. BSCS
St. Dominic Savio College
Philippines
|
|
|
|
|
A class, unless it's the form itself, shouldn't care anything about any controls outside of it. This only worked in VB6 because, due to VERY bad practice, every form was visible to every piece of code in the app as a "global". This is, thankfully, no longer the case in VB.NET due to true OOP support.
Your class should expose a status property that the form code can use to update itself. This class could even expose an event that the form could subscribe to so it get's a notification that the status has changed.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
hello every one
I need to create button when the program is running,i wrote the code but the CLICK event is not enable and when i click on button ,no event happen.how is it solved?
|
|
|
|
|
You have to wire up the events you want to handle yourself. If you have to also destroy the button in your code, you have to disconnect the event handler too.
You use AddHandler and RemoveHandler[^] for these purposes.
To wire up the Click event of a button, it's as easy as this:
Dim myButton As New Button
myButton.Location = ....
Me.Controls.Add(myButton)
AddHandler myButton.Click, AddressOf MyButtonHandler
.
.
.
' The method signature must match the normal button click event handler signature!
Private Sub MyButtonHandler(ByVal sender As Object, ByVal e As System.EventArgs)
' Button Click code goes here...
End Sub
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
How to create a multithreading application?
Mark Angelus V. Movida
Programmer
|
|
|
|
|
Open a new project and start coding??
Really, this is not an answerable question. There are many thousands of possible applications for multi-threading. What you do depends entirely on what your application is doing and the situation for which you need it.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
After three days i could'nt find how to handle message. i know it is very simple because i did it in delphi. Found an article in codeproject articles, but that code not true code for me. I just want to send message (with sendmessage api) to my parent window, and handle thats all.
is there anybody experienced this subject ???
|
|
|
|
|
Hi, if I recall correctly:
In your parrent window, use SetWindowLing API with GW_WNDPROC constant and address of a function (whose signature you may find in MSDN).
SetWindowLong returns a pointer to oldproc of the window wich you must save in a variable and pass the events to this procedure, at the end of your new windowproc.
now in the child window and the parrent window, creat a message using RegisterWindowMessage which returns a unique window_message handle.
Then in the child window call SendMessage with the registered windows handle and in parent form check it out!
jope it was helpful
|
|
|
|
|
Hi,
I am trying to write a login script that checks the exchange server currently set up in the User's outlook profile and change it to a new one if needed.This should be possible (i think) but i can't seem to get a handle on it.
All i need to know is how/where i can access/change the Exchange server currently set up for that user's outlook profile. I know i can access some outlook properties through WMI but none get or set the exchange server it connects to.
Could anyone point me in the right direction?
|
|
|
|
|
Hi all,
I have a VB.Net Application that is run over Citrix. Everytime I try to run from the Citrix shortcut I get Application has generated an Exception that cannot be handles. The thing is the other 2 developers don't have this problem. And After it was rolled out to clients, 100 people work but I have one user that gets the same error.
Does anyone have an idea what is going on here?
TIA,
Chuck Easter
-- modified at 10:50 Wednesday 18th April, 2007
PS.. I can run the project when I run from the file share. Just not thru the shortcut.
Forgot to say that the first time.
|
|
|
|
|
There's no way to tell what's wrong without knowing what the Exception is or what the application was doing at the time it bombed.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|