Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

running script over reboot

Featured Replies

I'd like to write a script file that executes a few commands then re-boots the host machine (Windows 7), and then starts over after it booted up, and do this X times. (X could be anything from 5 to 5,000)

I believe to do this I would either need to modify the script (loop count) before reboot, so it would be a self modifying code, or use some variable (perhaps SET SomeName=SomeName+1) to keep the count.

Does anyone know any examples? (don't want to re-invent the wheel if I don't have to)

Any common scripting language should be fine, though my current scripts (just looping) are written in powershell and in ironpython.

TIA


Put the script in the registry run key, write a registry entry somewhere for your countdown. Delete the run key value after reaching zero.

Or put it in the runonce or runonceex key and rewrite it to the runonce key after each run until the count is zero, again tracking via a registry value.

With IcemanND solution, you'll also need autologon enabled and use sysinternals autologon.

There are other ways to do this:

- creating a service that will run your script with sc and srvany.exe (from the 2003 Reskit) or using nssm and be removed after.

- creating a scheduled task which will run a each computer startup until you don't need it anymore.

True, autologon would be needed, he would need it for his initial thoughts also.

Getting scripts to run as desired can be tricky when done as a service. The Scheduled task at startup is a nice idea though, depends upon what he needs to do and under what user context.

  • Author

Thanks for the great ideas.

The programs I want to run are a couple of console mode executables with their outputs redirected into a log file.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.