Solved

Start Bat, restart if closed?

Posted on 2014-01-06
7
358 Views
Last Modified: 2014-02-15
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
Comment
Question by:Pancake_Effect
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 69

Expert Comment

by:Qlemo
ID: 39760740
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
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 39761348
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
 
LVL 34

Expert Comment

by:sarabande
ID: 39762468
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:Pancake_Effect
ID: 39762816
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
 
LVL 69

Expert Comment

by:Qlemo
ID: 39763084
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
 
LVL 4

Author Comment

by:Pancake_Effect
ID: 39804224
Autologon will handle login startup items your saying?
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 39804247
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

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
simplest php form 3 85
T-SQL: Preventing Duplicate Records from Being Returned When "Joining" Code Blocks 2 61
programming a polycom voip phone 3 54
batch file or script 4 48
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question