Jump to content
Sign in to follow this  

VBS conversion to AU3

Recommended Posts


I am trying to convert a VBS script for remote assistance to AU# and am having a problem getting the variable for the computer name to work correctly. Any assistance is appreciated.

The original code is as follows:


set shell = createobject("wscript.shell")

dim strComputerName


shell.run "hcp://CN=Microsoft%20Corporation,L=Redmond,S=Washington,C=US/Remote%20Assistance/Escalation/Unsolicited/Unsolicitedrcui.htm"

shell.AppActivate("Help and Support Center")

wscript.sleep 2000

shell.sendkeys "{TAB 9}"

shell.sendkeys strComputerName

wscript.sleep 500

shell.sendkeys "%c"


My AU3 is :

#include <WindowsConstants.au3>

Local $machine

$machine = ObjGet ("WScript.Arguments.Item(0)")

If @OSVersion = "WIN_XP" Then

;Then c:\windows\explorer.exe "hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/Remote Assistance/Escalation/Unsolicited/Unsolicitedrcui.htm"

Run(@ComSpec & " /c " & 'explorer.exe' & "hcp://CN=Microsoft Corporation,L=Redmond,S=Washington,C=US/Remote Assistance/Escalation/Unsolicited/Unsolicitedrcui.htm","",@SW_HIDE)

ElseIf @OSVersion = "WIN_7" Then

MsgBox (4096, $machine,"")

Run(@ComSpec & " /c " & 'C:\Windows\system32\msra.exe ' & "/offerra","",@SW_HIDE)


Share this post

Link to post
Share on other sites

If you need a command line argument you can use $CmdLine[] array. In the Help File this is found under Using AutoIt --> Running Scripts.

So it would be something like $machine = $CmdLine[1]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.