Posted By

kenray on 11/15/08


Tagged

Shell UNC


Versions (?)

stsSetShellUNCCheck


 / Published in: Revolution
 

Turns on or off the flag that Windows uses when running a command statement in the shell as to whether it returns a warning when the current directory is a UNC path, or not. Returns empty if successful, and an error message if not successful.

  1. on stsSetShellUNCCheck pState
  2. if the platform is not "Win32" then
  3. return "STSError: stsSetShellUNCCheck can only be used on Windows."
  4. else
  5. if pState is not among the items of "true,false" then return "STSError: 'State' param must be one of 'true,false'"
  6. if pState then
  7. if not(setRegistry("HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DisableUNCCheck",binaryEncode("H*","01000000"),"dword")) then
  8. return "STSError: Attempting to set DisableUNCCheck returned:" && (the result)
  9. end if
  10. else
  11. if stsIsShellCheckingForUNC() then
  12. if not setRegistry("HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DisableUNCCheck","") then
  13. return "STSError: Attempting to delete DisableUNCCheck returned:" && (the result)
  14. end if
  15. end if
  16. end if
  17. end if
  18. end stsSetShellUNCCheck

Report this snippet  

You need to login to post a comment.