We Recommend

Accelerated C# 2008 Accelerated C# 2008
This book is both a rapid tutorial and a permanent reference. You’ll quickly master C# syntax while learning how the CLR simplifies many programming tasks. You’ll also learn best practices that ensure your code will be efficient, reusable, and robust. Why spend months or years discovering the best ways to design and code C# when this book will show you how to do things the right way, right from the start?


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.