Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

Start Bat, restart if closed?

Okay so we have a kiosk at work we got a while back. When you first log in it brings up a command line window that brings up the IE homepage. If you close out of either the homepage or the bat CMD that brought the home page up, it restarts IE and brings the homepage back up.Because it's a kiosk, this is handy because it restarts if the user exit's out of it.

Long story short, I had to delete the profile for reasons that don't matter and now it stopped working. Before I deleted it, I backed up the bat that opened the IE but I tried looking everywhere for whatever made that bat file open in the first place.

I looked to see if it was a scheduled task, another batch running, and I could not figure it out. It was none of them.


So can anyone tell me what they did, or how to make that bat open again automatically?


Just to recap, I have a bat file that opens up our internet homepage, if you close it, it opens back up again.

How do I do this again? I have the bat, I just need it to automatically open again like it was doing before. This is on a XP machine.
0
Pancake_Effect
Asked:
Pancake_Effect
1 Solution
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Most probably the Explorer.Exe was replaced as Windows GUI. The corresponding key is
HKEY_Current_User\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon. Change the value Shell to "cmd /c c:\PathToBatch\BatchFile.cmd" .
0
 
ThommyCommented:
Maybe there is some kind of restart tool installed on your computer.

Have a look at following tools...
Tools to Automatically Restart a Crashed or Closed Application
0
 
sarabandeCommented:
from your description it sounds as the bat file wouldn't start at all now?

if that is true, you could add it to the startup folder of the new user (profile).

alternatively you may add a new string entry to the

  HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

the name of the string entry is arbitrary and the value is the full path to the batch file.

if you do either method, it would start the batch at login again.

the technique to restart the batch when closing the IE or the batch file could be done in the batch file itself. if for example the last statement in the batch file is a call to itself it would restart when IE was closed.

however that would not prevent the user from closing the bat file. this could be achieved by starting the batch file with the start /B command. doing so, the batch file only could be stopped by CTRL+BREAK.

note, they also could have used other techniques. it is rather simple to write a launcher of a batch file or download one and windows has various possibilities to make it run like you described.

Sara
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
Pancake_EffectAuthor Commented:
Thanks everyone for the help. While I'm not sure how they originally did it, I do have a guess. I'm thinking that they made the bat a service. I've been playing with it, and I made it a service and it works just like they had it. However I run into a problem that I can make the service run as the certain user. It only works with the local user because it gives me the option to run on the desktop. I need it to run as the currently logged in domain user :(

no option for log on as

I'll play with the other options you guys have given me. I think your guy's options will work, and I will give it a try. But just for my own curiosity I was trying to figure out what they used originally because it was so smooth, it's going to bug me :P  I know it came heavy with a lot of options configured to use Sysinternals, I was looking to see if there was one program in Sysinternals that had a feature like this.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Since you only deleted the original user profile, it cannot have been a service. A service is defined at machine level, not user level.
And yes, you can't provide the "current logged-in user" as service account, only specific ones, and only Local System can access the user's session for interaction (and only on a different, sandboxed display, for security reasons).

Startup Folder will not help. It is run by the Explorer.exe started on log in, and with that you have Start Button, Task Manager aso., which again need to be prohibited with GPOs or registry settings.

All settings for a user profile require that the user is logged in automatically. That can be managed with SysInternals AutoLogon, which will set registry keys and store the password int local SAM (for keeping it encrypted).
0
 
Pancake_EffectAuthor Commented:
Autologon will handle login startup items your saying?
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
No, it will just set up that a specific user is logged in automatically. Whether the usual Explorer shell is started then, again starting StartUp folder items, is not its business.

If you change the Shell registry key as stated above, the command will run. But terminating the command will not restart, that needs an addition:
   "cmd /c c:\PathToBatch\BatchFile.cmd & logoff"
0
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.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now