Jump to content

Script in Autostart schreiben


Recommended Posts

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

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

Eggsplorer,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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?

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

×
×
  • Create New...