locked
Delete profiles on boot up RRS feed

  • Question

  • Hi

    I want to be able to automate deleting of profiles on boot up.  I'd like the PC to execute

    cmd /c remprof username

    on boot up.

    The user in question normally logs into the PC so it must be excuted before they login.

    I tried using the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce key, but this doesn't seem to execute until someone logs in.

    For various reasons I can't use a start up script either.

    Any ideas?

    Cheers

    Mr P


    • Edited by Mr P Monday, February 25, 2013 11:49 AM
    Monday, February 25, 2013 11:48 AM

Answers

All replies

  • For various reasons I can't use a start up script either.

    Does this mean that it does not work as a startup script or that you are unable to use this methord?

    Another way would be to use a service would run at startup you would have to point it to cmd.exe and then add your command into a .bat file as a paramitor. For this I would reconmend a search for "run as service" and you will find many applications most free which will install a programe .exe as a service.


    8B17

    Monday, February 25, 2013 3:39 PM
  • Monday, February 25, 2013 3:41 PM
    Moderator
  • Hi

    Thanks for the replies. It might be easier if I give a bit more context to the question.

    I've noticed that a lot of incidents in our organisation are resolved by one of few different fixes. One of these fixes is to delete the locally held profile and logon agian so a fresh copy is pulled from the file share.

    I would like to provide users with a button to automate this task for them. My origional idea was to add the remprof command to the runonce key in HKLM but this won't execute until they login and so it can't delete thier profile. I don't want to use a login script because it creates further group policy processing overhead.

    I've been experimenting with logging the user off and running the script with psexec -s so it survives the logoff process, and when it detects the user is no longer logged on run the remprof, but I can't get this to work.

    Cheers

    Mr P

    Tuesday, February 26, 2013 8:57 AM
  • Can you not use a computer startup script instead of login this will run before the user logon but would require a restart not just a logoff and logon.


    8B17

    Tuesday, February 26, 2013 10:02 AM