Run a program or sicript after two restarts

A

Ahmed

hi all
I know how to put a batch file a program or script in the startup folder and
run it everytime the computer starts or just run it once. What i want and
woul like to ask you all is how to run a program the second time computer
starts. i am using sysprep and making some changings the first time the
computer starts and the auto admin log in but i want another script to run
only on the second time the computer starts. regards to all
 
P

Pegasus [MVP]

Ahmed said:
hi all
I know how to put a batch file a program or script in the startup folder
and
run it everytime the computer starts or just run it once. What i want and
woul like to ask you all is how to run a program the second time computer
starts. i am using sysprep and making some changings the first time the
computer starts and the auto admin log in but i want another script to run
only on the second time the computer starts. regards to all

You can do it like so:
@echo off
if exist c:\SecondTime.txt (
del c:\SecondTime.txt
call c:\Sysprep.bat
) else (
echo %date% %time% > c:\SecondTime.txt
call c:\PrepareThings.bat
)
 
A

Ahmed

thanx alot

Pegasus said:
You can do it like so:
@echo off
if exist c:\SecondTime.txt (
del c:\SecondTime.txt
call c:\Sysprep.bat
) else (
echo %date% %time% > c:\SecondTime.txt
call c:\PrepareThings.bat
)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top