1

I found 6 simple scripts (.bat and .vbs) for remote pcs (Win XP and 7) to Clean Profile properly and faultlessly:

  1. Script: sending Ping to check Remote PC On or Off (.bat)

  2. Script: checking who logged in/on Remote PC (.bat)

  3. Script: restarting remote PC with a warning message (.bat)

  4. Script: restrict the Remote Users to log on/in till I finish works (.bat)

  5. Script: deleting Remote Users Profile (folder-subfolder-files) and their Regedit Keys (.vbs)

  6. Script: removing restriction the Remote Users to log on/in till I finish works (.bat)

I don't know how we can combine these 6 scripts.
Is there any script you know (doing 6 scripts job via one script)?
By the way, Windows Remote Desktop really takes a long time compared to 6 scripts, so we need to use a more simple way.

Thank you in advance and sorry for my bad English.

2
  • its trivial to write a batch file or powershell script to simply call the scripts in question, but your biggest issues will be getting those scripts to execute on the logout event while running for the user being deleted, and how to handle the reboot. that pretty much means that you will have to schedule multiple jobs. Jun 4, 2014 at 11:47
  • I am only smiling :)
    – serdar
    Jun 4, 2014 at 14:51

1 Answer 1

0

First, If it's an option, I'd strongly suggest you to move to Powershell. It's a bit hard to learn an migrate, but it pays off.

As to the matter at hand, what are you trying to achieve? it sounds like you're trying to create mandatory profiles by hand...

Anyway, 1. you can either "ping" the user's session, or 2. attach the cleaning task to the user's logoff.

  1. If you want to check repeatedly if a user is logged on, you can use the script you already have inside a loop, until you get an empty result (meaning there's no user logged-on).

  2. If you want to attach it to the logoff event, you can using the event viewer of some group policy, but I think it would be a bad idea - it'll somewhat complicate things and you'll have less control (comparing to the previous solution).

14
  • We want to combine 6 working script.
    – serdar
    Jun 5, 2014 at 6:59
  • These 6 scripts work properly seperately!
    – serdar
    Jun 5, 2014 at 7:00
  • Exactly, they are already working, so where's the problem to combine them? You can make one central script that calls all other scripts, and as I said above, "ping" the user session with your script and only then move on.
    – EliadTech
    Jun 5, 2014 at 10:54
  • I didnt make 6 scripts, only I found :(
    – serdar
    Jun 5, 2014 at 12:05
  • And I dont know how I can combine them :(
    – serdar
    Jun 5, 2014 at 12:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .