So i have batch1 as this

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /V 2 /D "%~d0\bat\batch2.bat /f

and then I reboot the computer (Windows 8) and batch2 starts.

It seems like the batch file is starting before windows because there is only a black background and the cmd window.

When I "x" the batchfile, windows continues booting.

My problem is that I need the computer connectet to internet to get my batch working.

So I need the batch to load after windows has finished loading.

Any clue? :-)

  • Try start /? in command line. It's not a program but a built-in command, so you may have to run it via cmd's argument. – gronostaj Oct 31 '14 at 0:05
  • Im not sure if i understand you. Should i set start /? in my batch2? issnt start /? just list off start commands? – Stian Størstfeskar Andersen Oct 31 '14 at 6:35
  • start /? displays help for the start command. Run it in a command line, read what it says and decide if it's what you need. (it probably is) – gronostaj Oct 31 '14 at 9:59
  1. Do not give it into HKEY_LOCAL_MACHINE, but into HKEY_CURRENT_USER. Keys under HKLM are running after system load, HKCU keys are running after user logon.

  2. For delay the execution (if you need internet connection), give at the first position

    ping -n 10>nul

    for 10 second delay.

  • Wet kiss in tha face! Big tanks! I will test it out! – Stian Størstfeskar Andersen Oct 31 '14 at 19:09
  • Or you could just do sleep 10 for 10 seconds delay ;) – gronostaj Nov 2 '14 at 17:04
  • Yes, you could also use sleep, but using ping on loopback is faster (for CPU), than using sleep.exe – Dolmayan Nov 3 '14 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.