Jump to content

Welcome to We Got Served Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

Gpedit.msc

- - - - -

  • Please log in to reply
4 replies to this topic

#1
spile

spile

    Advanced Member

  • Members
  • PipPipPip
  • 461 posts
  • Gender:Male
  • Location:Worcestershire, UK
I have a logoff script created with gpedit.msc
It runs a .bat file. that sync's the files on my desktop with those on my WHS.

However it only works if I first open gpedit.msc or console.msc
If I log onto the PC without opening gpedit.msc and log off again the script fails to run!

I wonder if anyone has any ideas?


Upgrade to a WGS Supporter Account to remove this ad.

#2
Drashna Jaelre (WGS)

Drashna Jaelre (WGS)

    Tinkerer

  • Lead Moderator
  • 12,328 posts
  • Gender:Male
  • Location:San Diego, CA, USA
  • Interests:Computers, Home Server (obviously), math, science, good books, friends
Contributor
about the only useful info I've found is maybe put "%comspec%" infront of the batch file. Or better yet, %comspec% /k file.bat"

Other than that, .... no idea. Tried looking into the event viewer?
Also, any reason you're using gpedit instead of just making a new scheduled task?

#3
spile

spile

    Advanced Member

  • Members
  • PipPipPip
  • 461 posts
  • Gender:Male
  • Location:Worcestershire, UK
Adding %compec% etc to the bat file doesn't do anything other than make log off take up to 15 minutes but thanks for the suggestion.

The following lines added to the .bat file shows that the script is being run but the lines to invoke SyncToy do not (they work fine if the bar file is run or gpedit.msc is run before logging off.

I looked at Task scheduler but it doesn't have a trigger for "Log off"

#4
spile

spile

    Advanced Member

  • Members
  • PipPipPip
  • 461 posts
  • Gender:Male
  • Location:Worcestershire, UK
After further investigation of the SyncToy logs I've found the following:
*** Failed to execute folder pair PC - WHS. Could not locate folder \\MyServer\Users\Share\.
It would therefore appear that the connection to the server is being lost before the logoff script completes.
Why running gpedit.msc causes the connection to remain I don't know.
My next step is to map the server shares to a letter to see if that retains the server connection so that the synctoy command can complete.

#5
spile

spile

    Advanced Member

  • Members
  • PipPipPip
  • 461 posts
  • Gender:Male
  • Location:Worcestershire, UK
Changing to the mapped drive letter made no difference. This issue is that the network drive is being logged off as soon as the logoff command it started and there doesn't appear to be a way of stopping it..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


Upgrade to a WGS Supporter Account to remove this ad.