Any chance that your computer will be locked at reboot time? I haven't confirmed but I think generic Send function doesn't work in locked session.
I would use something like _IEFormSubmit and _IELinkClickByText instead.
Something like this... If _ConfirmInputBox($inputmodel,"Model") Then Return
If _ConfirmInputBox($InputLoc,"Location") Then Return
If _ConfirmInputBox($InputDept,"Dept") Then Return
If _ConfirmInputBox($Inputrm,"Model") Then Return
If _ConfirmInputBox($inputbuild,"Model") Then Return
UpdateRecords()
Func _ConfirmInputBox($handler, $fieldName)
Local $ans
If GUICtrlRead($handler) = "" Then
$ans = MsgBox(4, "Empty", $fieldName & " field is empty. Do you want to leave it blank?")
If $ans = 6 Then
Return False
Else
Return True
EndIf
Else
Return False
EndIf
EndFunc ;==>_ConfirmInputBox
I think the best approach to your problem is write two programs.
1st one stay on the remote PC.
On launch, perform automated task.
Logoff on completion.
2nd program that start the remote session with startup program of 1st program.
works fine in Windows 7.
$var = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Font Management", "Active Languages")
ConsoleWrite($var & @LF)
console output;
0x12040000
You are jumping to the conclusion too quickly. So, here is test code with external GUI.
Send("#r")
Sleep(1000)
$index = ControlCommand("Run", "Type", "ComboBox1", "FindString", 'C:\Windows\SysWOW64\cmd.exe')
ControlCommand("Run", "Type", "ComboBox1", "SetCurrentSelection", $index)
My search string 'C:\Windows\SysWOW64\cmd.exe' was way down in the list.
I don't have same form windows as you have. I need something to test with... This shouldn't be any differenct than yours. I'm just testing FindString is working or not. And, it seems working fine to me.
This will work for most of OS. ^.^
Const $MY_PICTURES = 0x27
$objShell = ObjCreate("Shell.Application")
$objFolder = $objShell.Namespace($MY_PICTURES)
$objFolderItem = $objFolder.Self
ShellExecute($objFolderItem.Path)