Mark,

Couple of quick comments to enhance this a bit...

1. for posting, break your long lines to prevent left/right scrolling. This line is too big even for my 19" widescreen monitor! You can change this one:
 Code:
$RC = MessageBox(@CRLF + "Your PC MUST be rebooted to ensure that your Offline Files        " +
 @CRLF + "are configured properly." + @CRLF + @CRLF + "Click OK To Reboot", "Logon Script", 4112)

to
 Code:
$Msg = @CRLF + "Your PC MUST be rebooted to ensure that your Offline Files        "
$Msg = $Msg + @CRLF + "are configured properly." + @CRLF + @CRLF + "Click OK To Reboot"
$RC = MessageBox($Msg , "Logon Script", 4112)

You might be able to take advantage of Kixtart's forgiving nature and simply break the line after the "+" sign. I'm torn between convenience and good coding practice on that, though. \:\)

2. "RETURN" is used for Gosub. To exit a function, use "Exit", followed by the exit code. The exit code you return can be examined by the @ERROR macro. If your function succeeds, use "Exit 0", otherwise use "Exit 1" for generic errors, or a more appropriate code if possible.

3. You might want to revisit your return value choices. Since there are three possible return states, you might want to return 1 or 2 for the various success states (Migrate Successful or Disabled), and 0 to indicate error - check @ERROR status. Thus, you can do something like
 Code:
If MigOffLineFiles(old,new)
 'OK!'
Else
 @SERROR ?
EndIF

for simple migration tests.

4. Reference the source of the CSCCMD.EXE in the UDF header so someone that downloads the function can later recall where the dependent file is.

When it's done and tested, post it (code only) in the UDF forum. Put any commentary in a secondary post in the same topic, as the topmost posts are replicated to UDF mirror sites.

Looking forward to the finished UDF!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D