Posted By

kenray on 11/15/08


Shell UNC

Versions (?)


 / Published in: Revolution

Determines whether the OS has been set up to ignore UNC paths when in the shell. Normally, the OS will return a header in the result of any command while the current working directory is on a UNC path unless a flag is set in the Registry.

  1. function stsIsShellCheckingForUNC
  2. -- returns whether the registry has its DisableUNCCheck turned on or not
  3. if the platform is not "Win32" then
  4. return "STSError: stsIsShellCheckingForUNC can only be used on Windows."
  5. else
  6. put queryRegistry("HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DisableUNCCheck") into tResult
  7. if the result is "can't find key" then
  8. return false
  9. else
  10. if tResult <> "" then
  11. get binaryDecode("H*",tResult,tVal)
  12. if tVal = "01000000" then return true
  13. else return false
  14. else
  15. return "STSError: Querying for DisableUNCCheck returned:" && tResult & cr & (the result)
  16. end if
  17. end if
  18. end if
  19. end stsIsShellCheckingForUNC

Report this snippet  

You need to login to post a comment.