Problem running batch files in startup Windows 8

We have a DOS batch file in our Windows 8 Startup folder (and in Startup Tab in Task Manager) that seems never to run when the PC starts up.  How can we have a batch file running automatically in windows when the computer starts.
rayluvsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NVITCommented:
Task Scheduler.
Add basic task.
Trigger: When the computer starts
Start a program
Program/script: cmd
Add arguments: /c c:\foldername\filename.bat
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rayluvsAuthor Commented:
Didn't know about this, thanx!  Just finished creating and restarting the PC.
0
rayluvsAuthor Commented:
Didn't work and tried it twice.  Checked if it created any event to see why it didn't, but nothing.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

NVITCommented:
- Does the batch file access the network/domain? That could be a reason.

- Try temporarily replacing the .bat with a simple one. Just to see if it works. Maybe with a single line of code that writes text to a file:
>> "%temp%\startupresult.txt" echo %date% %time% echo "%0" computername:%computername% username:%username%

Open in new window

0
rayluvsAuthor Commented:
It's a local PC, no LAN.  

Will try with your example and see.
0
rayluvsAuthor Commented:
Didn't work.

Did noticed that if the application "Task Scheduler" is open, it works.  We change the trigger to open run the command when "Locked" and it worked.  But when we closed the "Task Scheduler"  and locked again the PC, it didn't.  Seems to need to have the apps open.

Please advice.
0
NVITCommented:
I just tested and it works here...

Windows 7.

- Add basic task.
- Trigger: When the computer starts
- Start a program
- Program/script: cmd
- Add arguments: /c c:\foldername\filename.bat

For filename.bat:
>> "%temp%\startupresult.txt" echo %date% %time% echo "%0" computername:%computername% username:%username%

Open in new window

Note: startupresult.txt is created under c:\windows\temp

On the last page of the basic task setup, check box "Open properties dialog for this task..."
- Under General tab...
- Change user/group. Browse. Type system. Pick OK. Back in the General tab, it shows as NT AUTHORITY\SYSTEM.
- Pick OK to close.
- Reboot.
- After you logon (probably even after it starts - I've not confirmed), startupresult.txt is created under c:\windows\temp
0
rayluvsAuthor Commented:
Thanx!  I forgot the CMD.

Worked!!!!
0
NVITCommented:
Awesome! I'm glad...
0
rayluvsAuthor Commented:
One last question:

Why placing the shortcut of the batch file in the startup folder didn't work?

(we placed it on 'C:\Users\user-name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup')
0
NVITCommented:
IDK. I just tested on my windows 8 RT, which also didn't work. It could be a safety/security thing.
0
rayluvsAuthor Commented:
Ok will proceed to close.
0
McKnifeCommented:
Since we deployed 8.1 domain wide more than a year ago, I can tell you that the problem is something completely different.
Establishing a task that uses a startup trigger will not help. Now you will ask "but Rayluvs wrote, that it helped" - correct, but it will not under normal circumstances, which are: users shutdown their computers in the evening and turn them back on next morning. The startup task is fired on startup. What is a startup in 7, what is a startup in 8.x? Astoundingly, these are different things. With win8, Microsoft introduced "fast startup" and "kernel hibernation". Whenever you shutdown win8 and turn it on again, it does NOT perform a startup but just a resume from kernel hibernation. Startup scripts will NOT run, tasks with the startup trigger will not run, neither will GPO based MSI installations run.

If however you select "restart", a real restart is performed. So to use startup scripts on a daily base, we would indeed have to turn off one of the most desirable features of win8.x: "fast startup".
0
rayluvsAuthor Commented:
Hey Thanx a LOT!!! Really helped us understand!!! Wish it was entered prior awarding because it deserves it!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.