Jump to content

Batch file wont be lunched


caramen
 Share

Recommended Posts

Hi all and THX.

Case $Langues

                           Local $Password= "aaaaaaaaa"
                           Local $UID= "bbbbbbbbbb"

                           GUISetState(@SW_SHOW, $Console)

                                          WinMove ("Console","",0,0)
                                          WinMove ("Migration profil","",300,0)

                           _GUICtrlListView_AddItem($ConsoleArea,"Changement de langue admin*...")
                           _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1)

                           Sleep (1000)

                           run (@SCRIPTDIR&"UI-FR.BAT" )


                           RunAsWait ($Password,@ComputerName,$UID,0,@ScriptDir&"\UI-FR")

                           MsgBox ( $MB_SYSTEMMODAL , "Migration V1.0", "Reboot necessaire.")

                           _GUICtrlListView_AddItem($ConsoleArea,"Langue changé reboot necessaire.")
                           _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1)

This case just lunching a *.BAT file but when i click the buttom the batch file is not lunched ... BUT the message box is coming so i am sure it s called properly but why does this batch is not lunched.... ?

Any one got a solution ?

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Willl it work for a RunAS with shell exec ?

I need admin right becose i am changing a reg key with that

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Sorry, ShellExectue will not work for you then. Below is an example of how it can work. Note that you must use the full path of the script. If there are spaces in the path name, you will need to include quotes.

Path without spaces:

RunAs("MyLoginName", @ComputerName, "password", 1, @ComSpec & " /c start c:test.bat")

Path with spaces:

RunAs("MyLoginName", @ComputerName, "password", 1, @ComSpec & "/c start " & '"' & "c:Program Filestest.bat" & '"')

Edited by abberration
Link to comment
Share on other sites

  • Moderators

So confusing...

run (@SCRIPTDIR&"UI-FR.BAT" )

- No "" between @ScriptDir and your file

RunAsWait ($Password,@ComputerName,$UID,0,@ScriptDir&"\UI-FR")

- No file extension after UI-FR.

- Your password is where your username should be.

- You have your $UUID where the password should go

- And no idea what the username is supposed to be, is that @ComputerName or $UUID or what?????

- And... If your path contains spaces it will fail.

At least take some darn time and read what the functions need to run before posting help me code.

How I would do it?
 
RunWait(@ComSpec & " /c " & '"' & @ScriptDir & '\UI-FR.bat"', "", @SW_HIDE)
 
RunAsWait($UUID, @ComputerName, $Password, 0, @ComSpec & " /c " & '"' & @ScriptDir & '\UI-FR.bat"', "", @SW_HIDE)
No idea if your $UUID or @ComputerName are in the correct places!

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

 

So confusing...

run (@SCRIPTDIR&"UI-FR.BAT" )

- No "" between @ScriptDir and your file

RunAsWait ($Password,@ComputerName,$UID,0,@ScriptDir&"\UI-FR")

- No file extension after UI-FR.

- Your password is where your username should be.

- You have your $UUID where the password should go

- And no idea what the username is supposed to be, is that @ComputerName or $UUID or what?????

 

- No file extension after UI-FR. > Yeah i was trying bat and cmd and forget to replace before post

- Your password is where your username should be. > becose i prefered to see UID before password and forget to change place of values too but not important since i dont see the batch lunched

- You have your $UUID where the password should go >  IDEM

- And no idea what the username is supposed to be, is that @ComputerName or $UUID or what?????

the log have to be completed like this ....

FRNB101010$UID(Local administrator) //// Tab //// $Password 

The @computername is to get the local name of the computer to be loged as a local admin ...

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

  • Moderators

There was no need to explain yourself, you accepted an answer, but thank you.

But that leaves even more disappointment really, the fact that "you preferred to see UID before password" and "it's not important".

Yes, it's very very important.  You're asking for help, it's very important that you have all your ducks in a row, because then you're wasting our time in trying to figure things out why things are failing for you.

I don't know what IDEM means, but I'll assume it is some slang meaning that it's the same as you mentioned before, so if that's the case... I'll just leave this as IDEM.

But again, thank you for explaining

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Case $UAC


                 RunAsWait($UID, @ComputerName, $Password, 0, @ComSpec & " /c " & '"' & @ScriptDir & '\UAC.bat"', "", @SW_HIDE)

For exemple this is not working.

 

SmOke_N:

 

I am realy sorry... i am very very busy and trying to get somthing work and working at same time that's why ...

Thx you too :)

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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...