schtasks /create batch

superpeon2002

New Member
I have a query since you are more experienced because when I do my schtasks /create by batch and then I test it in my virtual machine placing it in my iso and I want it to run automatically but the first thing I did was place the batch in shell startup and the batch that I want it to run, place it on disk C: with name test but when placing the batch in shell startup so that it is created automatically with the batch that puts an example schtasks /create /tn "\test" /sc onlogon /delay 0005:00 /ru YOU /it /tr test.batch because my batch never starts after logging in there it allows me to export the XML BUT I DON'T know where to put that xml so that it sticks to my iso and runs someone who I know it would help me and so I would learn something new today thanks
 
Scheduled tasks can be created in Post-Setup, by following the rules:

1. Run schtasks in Post-Setup (Machine), because it requires Admin rights.
2. To schedule tasks under a local account, user must be created first in Unattended, or by running "net user /add" before "schtasks /create".

3. The executed batch file must be in a correct folder path. Normally, user folders are not created before Setup runs OOBE.
Create a new folder in the ISO directory, sources\$OEM$\$1\Folder and copy your batch file there.​
$1\Folder = C:\Folder
$1\Users\Folder = C:\Users\Folder
$$\Folder = C:\Windows\Folder
Files copied to $OEM\$$\Setup are removed when OOBE is done.​
4. Folder paths with spaces must be quoted: "C:\Users\SP2002\My Folder\Test.bat"

Code:
schtasks /create /tn "test" /sc onlogon /delay 0005:00 /ru Username /it /tr "C:\path\Test.bat"
 
Scheduled tasks can be created in Post-Setup, by following the rules:

1. Run schtasks in Post-Setup (Machine), because it requires Admin rights.
2. To schedule tasks under a local account, user must be created first in Unattended, or by running "net user /add" before "schtasks /create".

3. The executed batch file must be in a correct folder path. Normally, user folders are not created before Setup runs OOBE.
Create a new folder in the ISO directory, sources\$OEM$\$1\Folder and copy your batch file there.​
$1\Folder = C:\Folder
$1\Users\Folder = C:\Users\Folder
$$\Folder = C:\Windows\Folder
Files copied to $OEM\$$\Setup are removed when OOBE is done.​
4. Folder paths with spaces must be quoted: "C:\Users\SP2002\My Folder\Test.bat"

Code:
schtasks /create /tn "test" /sc onlogon /delay 0005:00 /ru Username /it /tr "C:\path\Test.bat"
I love you man thanks for responding so fast
 
superpeon2002, what does your scheduled task's .bat file do? I want to make sure this isn't a scenario where you can accomplish the exact same thing you want, but in a much easier and better way. If you upload your .bat file, we can see if there are alternative methods that are more simple.
 
Last edited:
Hellbovine
I just wanted to know that you help me because when I put it in shell startup it doesn't execute that command I want it to open only when I start my windows my iso do you understand I don't know what the command is to run that's why it puts it in shell startup but it doesn't execute Then I go to task scheduler and I see that my batch is not executed but when I manually click on it, the task scheduler of my batch is just created

@echo off schtasks /CREATE /RU %username% /TN "TaskName" /TR "C:\Windows\System32\script\hola.bat" /SC ONLOGON /IT /RL highest

I want this to be executed automatically when I start my windows but your partner does not explain it to me but I do not understand much anyway I appreciate your help for these are the forums to learn and investigate

and my batch are only changes to regedits redd add and other things to optimize windows 10 but with a batch that I want when I start my windows to only run delete unnecessary files for me I am testing ntlite and testing things with batch learning I know that several They already did it but I want to try to do it myself in the batch add things like having the old alt+tab not the one from windows 10 disable various telemetry things with winodwsu pdate etc

echo Disabled WindowsUpdate
reg add "HKLM
It would be good if you could upload videos in this forum so I would record a short video and upload it so they would help me more easily
 
Hellbovine
I just wanted to know that you help me because when I put it in shell startup it doesn't execute that command I want it to open only when I start my windows my iso do you understand I don't know what the command is to run that's why it puts it in shell startup but it doesn't execute Then I go to task scheduler and I see that my batch is not executed but when I manually click on it, the task scheduler of my batch is just created

@echo off schtasks /CREATE /RU %username% /TN "TaskName" /TR "C:\Windows\System32\script\hola.bat" /SC ONLOGON /IT /RL highest

I want this to be executed automatically when I start my windows but your partner does not explain it to me but I do not understand much anyway I appreciate your help for these are the forums to learn and investigate

and my batch are only changes to regedits redd add and other things to optimize windows 10 but with a batch that I want when I start my windows to only run delete unnecessary files for me I am testing ntlite and testing things with batch learning I know that several They already did it but I want to try to do it myself in the batch add things like having the old alt+tab not the one from windows 10 disable various telemetry things with winodwsu pdate etc

echo Disabled WindowsUpdate
reg add "HKLM
It would be good if you could upload videos in this forum so I would record a short video and upload it so they would help me more easily

to quote garlin .... " We don't make videos on this board. "

Please do not ask for videos in future
 
superpeon2002, I understand your problem, but I still stand by what I said. This forum is also about teaching people too, and I would rather show you (and lurkers) different methods to achieve the same thing, rather than to encourage a complicated route like scheduled tasks and .bat files, unless for some reason that route is mandatory for a certain tweak. I have an optimized system for gaming, and I did not use post-install for anything.

If you upload your .bat file I will take the time to see if I can come up with a new solution for you. Right now, the only thing you have articulated is that you want to disable Windows Update and add some registry keys, and both of those things can be achieved with much easier and better methods, such as integrating the registry keys directly into the image.

Probably nobody will make a video, and even if we did it would likely be in English anyway, and that will not help you. Garlin's steps were clear to me, so if you do not have the technical skills to figure it out from there, then we need to go back to what I am saying, which is to try a new method.

Also, have you taken a look at all the guides on this site, so that you are not spending time reinventing the wheel? Below are some of the guides that exist to help you get started with NTLite and optimizing Windows:

1) Guide: Choosing a Preset (link)
2) Guide: NTLite for Beginners (link)
3) Guide: Installing Windows (link)
 
Last edited:
sorry no speak ingles
I'm sorry i don't speak swahili.


you know there are far better details than something created 11+ years ago, and microsoft themselves give a very detailed and complicated explanation of that...... besides, a lot has changed since that video was made...... windows went up a few numbers.

BUT, in order for us to help you, you have to meet us half way so we can help. THAT is the area we are at .....
 
Someone recently asked for a link to the old forum and was politely told that it was all old not up to date information.
Ive seen many windows/+related videos that dont tell you diddly squat, they just show a mouse cursor jumping around like its got ants in its pants.
 
Back
Top