Jump to content

VBS conversion to AU3


McGyver
 Share

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:

'start

set shell = createobject("wscript.shell")

dim strComputerName

strComputerName=WScript.Arguments.Item(0)

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"

'end

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)

Endif

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...