Useful InputBox for Copying HardwareID out in VBScript


I have designed a Windows COM component and write a VBScript to obtain hardware ID using VMProtect API. The first edition of the script is just simply using MsgBox to output the string.

1
2
3
4
Dim Obj
Set Obj = CreateObject("HelloACM.Application")
 
Msgbox Obj.GetHardwareID
Dim Obj
Set Obj = CreateObject("HelloACM.Application")

Msgbox Obj.GetHardwareID

This gives something like this:

vbscript-msgbox-hardwardid Useful InputBox for Copying HardwareID out in VBScript COM/OLE vbscript VMProtect Win32 API

vbscript-msgbox-hardwardid

So, the question comes, it is not user-friendly at all. The user cannot copy the string to clip board. You can write some extra vbscript code to write the string to a text file and launch a notepad afterwards; or launch a IE window (browser) with a textbox filled with the string; or sending the email; or you can use some tricks to copy the string to clipboard etc…

All these methods seem over complicated. What I want is a simple method that allows user to copy out the string with no hassle. So my colleague suggested me a simple method without writing too much code. Yes, the InputBox inbuilt function supported by VBScript.

1
2
3
4
Dim Obj
Set Obj = CreateObject("HelloACM.Application")
 
InputBox "HardwareID", "HardWareID", Obj.GetHardwareID
Dim Obj
Set Obj = CreateObject("HelloACM.Application")

InputBox "HardwareID", "HardWareID", Obj.GetHardwareID

The third parameter is the default value put in the editable textbox. The first parameter is the prompt and the second is the title of the dialog. The user can easily copy out the string by selecting the text in the prompt dialog and right click for menu (or just simply press Ctrl and C)

vbscript-inputbox-hardwareid Useful InputBox for Copying HardwareID out in VBScript COM/OLE vbscript VMProtect Win32 API

vbscript-inputbox-hardwareid

I thought of the solutions over complicated at the first and how easy this thing should be! It saved my day (adding more APIs or writing too much ugly VBScript code because VBScript does not support inherently the GUI windows or clipboard stuffs). Communication/Discussion is important and useful (that will avoid us re-inventing the wheels)

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
429 words
Last Post: The IT interviews differences between UK and USA
Next Post: RedHat Previlege Escalation Vulnerability CVE-2015-1805

The Permanent URL is: Useful InputBox for Copying HardwareID out in VBScript

Leave a Reply