Question Locked

VB Script help!!!

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi i have a script problem and script is a dark art to me!!

im trying to creat a logoff script that i can run from a GP to get rid of cached roaming profiles. i have tried several different scripts that i have cobbled together from bits that I have found on the net or from other scripts that I have. Below are several ones that I have tried but when you run them they come back with a syntax error code 800A03EA which means nothing to me as I don?t know VB at all. Can someone please send me the right script or point out where I have gone wrong with the ones I have copied in.

cheers

my first try

objShell.Run \\server1\netlogon\delprof.exe /q /r

end if
end sub

my second try

with WScript.CreateObject("WScript.Shell")

.run "%logonserver%\netlogon\delprof.exe /q /r"

end with

End Sub

5 replies

by ic-it

create a GPO with this setting.

MACHINE Administrative Templates\System\User Profiles Delete cached copies of roaming profiles

by thegman

Yeah tried this first, but it doesn?t work. I have used gp result to see if the policy is being brought down and it is with out any problems so I read up on it and found some other settings with in that section to do with waiting for profile and cse. I have done all of this but still the profiles are there.

I then came across this exe and I have tried running it manually and it works!! But now I need to run it in a log off script but I don?t know how to write the script. Im more a hammers and spanners man than a scripter.

I just need to know what to have to typed in the script to start the exe, I know the switches I require for the script but I just don?t know how to write it!

and im afraid that the document from microsoft meant nothing to me

by jiminpa

Set oShell = wscript.CreateObject("Wscript.shell")
oShell.run "%logonserver%\netlogon\delprof.exe /q /r"

This discussion is closed to new replies.