1

I have a Windows 7 computer with three accounts (in hierarchical order):

  1. Administrator (with password) type Administrator
  2. Guest (with a password different from that of Administrator) type administrator
  3. User (no password) type Standard user

On User's account, how can I create a batch file that once launched performs the following tasks:

  • Stop the service called Teamviewer active in the background
  • Stop the service Panda Cloud Office Protection
  • Open the browser explorer in "InPrivate mode"
  • Delete from the window event registry the three action previously held

A second batch file would serve to come back to the original situation, so it should operate like this:

  • Close the browser
  • Activate the service Panda Cloud Office Protection
  • Activate the service teamviewer
  • Delete the event log window of these three actions after having carried out

The two files would be launched in need through links on which it was previously activated the option Run as Administrator.

I want to avoid entering each time the administrator password or the guest to confirm the execution of the batch (I know both passwords).

Ultimately I would like to disable the two services with a click without I'll be prompted for the password, and without this being stored in the event log. Once I will end my search on the internet all will be set to the initial state just with a second click on the second .bat file.

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
AiaceT
  • 45
  • 8
  • Possible duplicate of http://superuser.com/q/42537, http://superuser.com/q/109741, http://superuser.com/q/103819, http://superuser.com/q/130803, http://superuser.com/q/810216, http://superuser.com/q/434504, http://superuser.com/q/453409, http://superuser.com/q/54260, or http://superuser.com/q/782090. – G-Man Says 'Reinstate Monica' Apr 19 '15 at 02:27

1 Answers1

5

If the services you refer to are Windows Services non admin users cannot stop or start them without elevating permissions. If you're talking about removing logs from the windows event viewer, that must also be done with admin privileges, and even then I think you can only clear the entire log, not selectively remove certain entries.

All of those things, if allowed to standard users, would be huge security holes in the OS. I don't think its possible to do what you want (except launch IE in InPrivate mode).

Andy
  • 283
  • 1
  • 4
  • 19
  • Looks like a comment to me. Please use the **add a comment** to place your comments – Prasanna Apr 18 '15 at 05:50
  • 2
    Meta-related: [Is “It's impossible” a valid answer, or is it a comment?](http://meta.superuser.com/q/7161/354511) – G-Man Says 'Reinstate Monica' Apr 18 '15 at 06:43
  • My apologies Andy, but why will be not possible if I can do this without using a bat files? If I know the psw from Admin and guest which would be the huge security hole? I know that I can use: RUNAS* ( with /SAVECRED to save credential and don't ask the psw NET STOP ( or START ) IEXPLORE -PRIVATE TASKKILL but I don't know how to formalize the bat files – AiaceT Apr 18 '15 at 13:38
  • @Prasanna I've answered the question; what the poster wants is impossible. – Andy Apr 18 '15 at 18:08
  • @AiaceT A standard user cannot stop and start services on Windows. Its part of the security of the OS and Windows forbids it. In a batch file I suspect your commands will imply print Access Denied. If the user tried to start the Services control panel and they are not an admin, they'll be prompted for the username / password of an admin account. That's just how windows works. – Andy Apr 18 '15 at 18:10
  • @G-Man Its not possible, and I think i've explained why; Windows just doesn't allow it. Is there something you feel i'm missing or is your link directed to prsanna? – Andy Apr 18 '15 at 18:11
  • @Andy: It was directed (1) to Prasanna and (2) to anybody who reads Prasanna's comment.  The question I linked to has arguments on both sides, some of which I consider to be good.  I'm basically on your side, since you offered some explanation.  I believe that your answer could be improved a little if you provided reference(s) (e.g., to Microsoft documentation) or explained why allowing a program or script to perform administrative actions without getting its privileges elevated would defeat the purpose of UAC. – G-Man Says 'Reinstate Monica' Apr 18 '15 at 18:29
  • @G-Man: [quote]why allowing a program or script to perform administrative actions without getting its privileges elevated would defeat the purpose of UAC[/quote] In this particular case, I want to give to user the possibilities to perform just a search on internet then comeback to the original situation. I don't want elevate user privilege neither that user know or insert a psw (admin psw or guest). For this reason I look for a batch file that perform what I had explained. User don't have to insert nothing if want perform a search on internet – AiaceT Apr 18 '15 at 20:08
  • @AiaceT: First of all, why are you replying to me?  You should be replying to Andy.  But, since you’ve addressed me: Your comment, “I don't want [to] elevate user privilege” doesn’t make sense.  You might as well say “I don’t want to break into your house; I just want to enter it.”  You know that disabling services requires privileges, and you want an ordinary user to be allowed to do it — that means you want to elevate privileges for the user. – G-Man Says 'Reinstate Monica' Apr 19 '15 at 02:27