Jump to content
Eggsplorer

Script in Autostart schreiben

Recommended Posts

Eggsplorer

Hi,

Ich hab ein Script für Windows Updates, dass nach dem OOBE aufgerufen werden soll. Run/RunOnce ist daher nicht möglich.
Stattdessen möchte ich das Script in den Autostart schreiben lasse. Wenn die OOBE beendet wird und der Administrator angemeldet wird, soll das Update-Script einmalig aufgerufen werden und sich anschl. selbst löschen.

Lang rede, kurzer Sinn:
Wie kann ich folgendes Script in den Autostart schreiben?

RunWait(@ComSpec & " /c " & "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File C:\UA\Scripts\win-updates.ps1 -MaxUpdatesPerCycle 100 -RestartRequired 1", "")

Ich würde ungern eine BAT oder EXE reinkopieren, da ich es unsauber finde. Die müsste ja auch zusätzlich irgendwo liegen.

Danke
Eggsplorer

Edited by Eggsplorer

Share this post


Link to post
Share on other sites
JLogan3o13
33 minutes ago, Eggsplorer said:

Hi,

I have a script for Windows updates that should be called after the OOBE. Run / RunOnce is therefore not possible. 
Instead I would like to write the script in the autostart. If the OOBE is terminated and the administrator is logged in, the update script is to be called once and then deleted itself.

Long talk, short sense: 
How can I write the following script in the Autostart?

RunWait ( @ComSpec  &  "/ c"  &  "C: \ Windows \ System32 \ WindowsPowerShell \ v1.0 \ powershell.exe -File C: \ UA \ Scripts \ win-updates.ps1 -MaxUpdatesPerCycle 100 -RestartRequired 1" ,  " " )

I would reluctantly a BAT or EXE reinkopieren, since I find it unclean. That should also be somewhere.

Thanks 
Eggsplorer

@Eggsplorer as this is an English forum, please endeavor to post in that language. It will go a long way toward people offering you help if they do not have to first try to decipher what you are asking. 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Melba23

Eggsplorer,

This is an English-speaking forum - please repost in that language. Or try autoit.de.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Eggsplorer

I am so sorry. I had this forum bookmarked and somehow thought it was german. I was in a rush when writing this post.

I'll create another post in english.

Share this post


Link to post
Share on other sites
Skysnake

Hi

Make a little AutoIt EXE, save it somewhere convenient and then place a link/batch file to it in the Shell:Startup.  You can also try the EXE directly in the startup folder, but Windows does not always honor this.

Skysnake


Skysnake

Why is the snake in the sky?

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

  • Similar Content

    • lenclstr746
      By lenclstr746
      Hi guys,
      Some functions of my script are running slowly. Very slow. What is the reason?
      My Code:
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Crypt.au3> #include <IE.au3> #include <Process.au3> #include <String.au3> #include <ImageSearch.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 1300, 700, 0, 0) $MenuItem1 = GUICtrlCreateMenu("Account") $MenuItem3 = GUICtrlCreateMenuItem("Login Acc.", $MenuItem1) $MenuItem4 = GUICtrlCreateMenuItem("Logout Acc.", $MenuItem1) $MenuItem5 = GUICtrlCreateMenuItem("Add Acc.", $MenuItem1) $MenuItem6 = GUICtrlCreateMenuItem("Delete Acc.", $MenuItem1) $MenuItem7 = GUICtrlCreateMenu("Collecting") $MenuItem8 = GUICtrlCreateMenuItem("Collect Start", $MenuItem7) $MenuItem9 = GUICtrlCreateMenuItem("Collect Stop", $MenuItem7) GUICtrlSetState($MenuItem8,$GUI_DISABLE) GUICtrlSetState($MenuItem9,$GUI_DISABLE) GUICtrlSetState($MenuItem4,$GUI_DISABLE) $oIE = ObjCreate("Shell.Explorer.2") GUICtrlCreateObj ($oIE, 0, 0, 1300, 700) $oIE.navigate("lp.darkorbit.com") _IELoadWait($oIE) b() Func b() GUISetState(@SW_SHOW) If FileExists("Acc.txt") = 0 Then MsgBox(16,"","Your acc. isn't find. Please Add a acc.") GUICtrlSetState($MenuItem3,$GUI_DISABLE) GUICtrlSetState($MenuItem4,$GUI_DISABLE) GUICtrlSetState($MenuItem6,$GUI_DISABLE) Else readacc() GUICtrlSetState($MenuItem5,$GUI_DISABLE) EndIf EndFunc #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem5 addacc() Case $MenuItem6 deleteacc() Case $MenuItem3 logacc() Case $MenuItem4 logoutacc() EndSwitch WEnd Func _Exit() Exit EndFunc Func addacc() $un=InputBox("Add Account","Please write your game username") $pw=InputBox("Add Account","Please write your game password. İt's safe pls trust our.","","*") $cun=_Crypt_EncryptData($un,StringToBinary("trust"), $CALG_AES_256) $cpw=_Crypt_EncryptData($pw,StringToBinary("trust"), $CALG_AES_256) FileWrite("Acc.txt",$cun&@CRLF&$cpw) GUICtrlSetState($MenuItem3,$GUI_ENABLE) GUICtrlSetState($MenuItem6,$GUI_ENABLE) GUICtrlSetState($MenuItem5,$GUI_DISABLE) Sleep(1000) readacc() EndFunc Func readacc() Global $rlu = _Crypt_DecryptData(FileReadLine("Acc.txt",1),StringToBinary("trust"),$CALG_AES_256) Global $rlp = _Crypt_DecryptData(FileReadLine("Acc.txt",2),StringToBinary("trust"),$CALG_AES_256) MsgBox(0,0,BinaryToString($rlu)&@CRLF&BinaryToString($rlp)) EndFunc Func collectdisableenable() If _IEPropertyGet($oIE,"locationurl") = $server & ".darkorbit.com/indexInternal.es?action=internalMapRevolution" Then GUICtrlSetState($MenuItem8,$GUI_ENABLE) GUICtrlSetState($MenuItem9,$GUI_ENABLE) EndIf EndFunc Func deleteacc() FileDelete("Acc.txt") Run(@ScriptFullPath) _exit() EndFunc Func logacc() Local $sx,$sy _RunDos("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255") GUICtrlSetState($MenuItem3,$GUI_DISABLE) GUICtrlSetState($MenuItem4,$GUI_ENABLE) GUICtrlSetState($MenuItem6,$GUI_DISABLE) GUICtrlSetState($MenuItem8,$GUI_ENABLE) GUICtrlSetState($MenuItem9,$GUI_ENABLE) If _IEPropertyGet($oIE,"locationurl") = "https://lp.darkorbit.com/" Then MsgBox(16,"","Now Do not touch anything. Wait login map. After click start button.",3) Sleep(100) ControlClick("Form1","","Internet Explorer_Server1","left",1,739,20) Sleep(250) ControlSend("Form1","","Internet Explorer_Server1",BinaryToString($rlu)&"{TAB}"&BinaryToString($rlp)&"{TAB 2}"&"{ENTER}") _IELoadWait($oIE) $link = _IEPropertyGet($oIE,"locationurl") $try = _StringBetween($link,"lp.darkorbit.com/","/main?authUser") If Not @error Then If $try[0] = "lp" Then MsgBox(16,"","Something went wrong. Please check your username and password. Try again.Your registered user name and your password is now coming.",5) MsgBox(0,"","Your registered username: "&BinaryToString($rlu)&@CRLF&"Your registered password: "&BinaryToString($rlp)) Exit EndIf EndIf Global $server = _StringBetween($link,"https://",".dar") $oIE.navigate($server[0] &".darkorbit.com/indexInternal.es?action=internalMapRevolution") _IELoadWait($oIE) Do Sleep(500) Until _ImageSearch("start.png",0,$sx,$sy,25) = 1 MouseClick("left",$sx,$sy,1,0) If _IEPropertyGet($oIE,"locationurl") = "https://"&$server[0]&".darkorbit.com/indexInternal.es?action=internalMapRevolution" Then TrayTip("","Login was succesfully.",2) Else TrayTip("","Error",1) Exit EndIf Sleep(2500) setsetting() EndIf EndFunc Func logoutacc() $oIE.navigate("lp.darkorbit.com") _RunDos("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255") GUICtrlSetState($MenuItem3,$GUI_ENABLE) GUICtrlSetState($MenuItem4,$GUI_DISABLE) GUICtrlSetState($MenuItem8,$GUI_DISABLE) GUICtrlSetState($MenuItem9,$GUI_DISABLE) EndFunc Func setsetting() Local $klx,$kly $1 = WinGetPos("Form1") MouseClick("left",$1[0]+650,$1[1]+350,1,0) ToolTip("Now Closing all tab's",$1[0]+150,$1[1]+250,"") Send("h") Sleep(500) ToolTip("Kullanıcı sekmesi aranıyor",$1[0]+150,$1[1]+250,"") If _ImageSearch("kullanıcı.png",0,$klx,$kly,25) = 1 Then MouseClick("left",$klx+10,$kly+3,1,0) EndIf ToolTip("Gemi sekmesi aranıyor",$1[0]+150,$1[1]+250,"") Sleep(100) If _ImageSearch("gemi.png",0,$klx,$kly,25) = 1 Then MouseClick("left",$klx+10,$kly+3,1,0) EndIf Sleep(100) ToolTip("Mnimap aranıyor",$1[0]+150,$1[1]+250,"") If _ImageSearch("minimap.png",0,$klx,$kly,25) = 1 Then MouseClick("left",$klx+10,$kly+3,1,0) EndIf EndFunc  
    • Pricehacker
      By Pricehacker
      Hello!
      I want to make a script that changes the filesize of program files while still having them run as usual.
      I tried FileWrite() but then the program wouldnt be recognized as a runnable program, could you guys help me to the right path?
    • HariKara
      By HariKara
      Hi AutoIters!
       
      Im trying to launch a .exe file that is nested within the program files (x86) folder structure. i have already used the standard RunAs Syntax and found that it fails to launch the application. I have switched to Run and that seems to work. My issue is I have to use RunAs as the applicaton would need to run under a completely different account. The Current logged in user is a Local User on the machine, however, the application must be run as a domain user. The Machine is domain connected.
       
       have tried the following:
      RunAs("username","logonpassword", $RUN_LOGON_PROFILE, "D:\Program Files (x86)\Vendor\Application Name\Exe Location\Executable.exe") The above fails to launch, there are no errors or syntax issues, it just does nothing when the variables are replaced for the correct values.
      I did the same using the Run command
      Run("D:\Program Files (x86)\Vendor\Application Name\Exe Location\Executable.exe") That seems to work fine, but runs in local user context. Any thoughts? Could it be a local Machine rights issue? Or have i missed something glaring in my script
    • TheSaint
      By TheSaint
      TeraCopy Timer - A program of mine, front end really, that I have been working on (on & off) for some time, but not shared here before, that I recall. Third party program TeraCopy is required.
      Many of you will be familiar with TeraCopy, and it has been discussed here at AF on several occasions, in various sub forums, including Chat.
      BE ADVISED - I still use an older version of TeraCopy (v2.27), a goody but an oldy, so have only tested my program with that. It may work with the newer v3.xx, or may be easily adjusted to do so, but I have not yet gone that route. Likewise, I only use it with Win 7 and Win XP, but I don't imagine there should be any issues with newer Windows. Add to that, my program being devised and created in AutoIt v3.3.0.0.
      So what is TeraCopy Timer and why might you need it?
      --------------------------------------------------------------------------------------
      Those familiar with TeraCopy use, know you can run multiple copy or move jobs either simultaneously or concurrently (one immediately after another has finished). With the free version at least, you have no control over precise order or timing, and no way to deal (without manual interaction) with the pesky Thumbs.db files in Win XP. TeraCopy Timer allows you to do all those things, and in a batch fashion.
      --------------------------------------------------------------------------------------
      Some screenshots and brief explanation
      Main Window
      Minimalist Window
      This new WAIT feature is the simplest and best way to use the program generally (in my view) ... but check out the following, as it is not always the case.
      Advanced Delay Window
      WARNING - It should go without saying, that you take all the usual precautions. For instance, don't use move with the only copy you have of precious files. BACKUP BACKUP BACKUP! Don't hold me liable for anything, except for being a nice guy who likes to share.
      TeraCopy Timer v2.8.zip  (see detail at Post #34)
      TeraCopy Timer v2.9.zip  (see detail at Post #35)
      Enjoy!
      OLDER DOWNLOADS
      P.S. I am not affiliated in any way with those who created and provide the excellent third party program - TeraCopy.
    • BogdanNicolescu
      By BogdanNicolescu
      While 1 / / / A whole bunch of codes found in help and here: https://www.autoitscript.com/autoit3/docs/ / / / WEnd OR:

       
      HotKeySet("{ESC}", "Terminate") While 1 MouseClick("Right",674,422) MouseClick("Left",673,447) Sleep(2000) / / / A whole bunch of codes found in help and here: https://www.autoitscript.com/autoit3/docs/ / / / MouseClick("Left",675,339) SLeep(3000) WEnd Func Terminate()     Exit 0 EndFunc  
      Sorry if i should't let this here to be found by newbies like me -.-'
×