TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: snownut2 on July 31, 2013, 06:49:57 PM

Title: Windows 7 - UAC Issues
Post by: snownut2 on July 31, 2013, 06:49:57 PM
Any one else having issues with the Windows UAC security settings being set to high.  Is there any way to ensure that a LISP function will complete its task, especially if writing files etc.

Title: Re: Windows 7 - UAC Issues
Post by: dgorsman on July 31, 2013, 06:57:37 PM
Thats kind of the point of the UAC - to keep programs from automatically doing potentially dangerous things.   :police:
Title: Re: Windows 7 - UAC Issues
Post by: trogg on August 01, 2013, 08:12:47 AM
We are constantly fighting the UAC.
It prevents AutoCAD and CADWorx profiles from being written to the registry.
It also prevents the users from dragging and dropping files to different folder when using ProjectWise even when it is only bumped up one notch.
Yet some IT updates seem to bump it up even though we request that they don't bump up the UAC...
~Greg
Title: Re: Windows 7 - UAC Issues
Post by: snownut2 on January 26, 2015, 04:22:39 PM
Has anyone tried this approach to changing the UAC settings for specific directories;

Code - Auto/Visual Lisp: [Select]
  1. (defun unlockdir ( dir uname / str )
  2.   (if (vl-string-search "(x86)" (setq str (vl-string-trim "Microsoft Windows NT Version" (getvar 'platform))))
  3.     (setq str (atof(vl-string-right-trim "(x86)" str)))
  4.     (setq str (atof(vl-string-right-trim "(x64)" str)))
  5.     )
  6.   (if (> str 6.0)
  7.     (startapp (strcat "icacls " dir "\\ /T /E /G " uname ":f"))
  8.     (startapp (strcat "xcacls " dir "\\ /T /E /G " uname ":f"))
  9.     )
  10.   );defun
  11.  
  12. (unlockdir (vl-filename-directory (getvar 'menuname)) (getenv "username"))
  13.  

Any serious draw backs ?

Here is link to explanation -  http://ss64.com/nt/xcacls.html (http://ss64.com/nt/xcacls.html)
Title: Re: Windows 7 - UAC Issues
Post by: ChrisCarlson on January 26, 2015, 04:53:44 PM
Are you writing to a dir that AutoCAD needs permission to use? C:\Users\User\CAD_Temp has worked for us
Title: Re: Windows 7 - UAC Issues
Post by: snownut2 on January 26, 2015, 04:56:49 PM
I've had issues modifying the the default menu file, to add toolbars to it. 
Title: Re: Windows 7 - UAC Issues
Post by: BlackBox on January 26, 2015, 05:16:01 PM
Any one else having issues with the Windows UAC security settings being set to high.  Is there any way to ensure that a LISP function will complete its task, especially if writing files etc.

No, but as I manage both CAD & IT here, I've intentionally granted user permissions to AutoCAD-related folders, etc... User's don't need access to entire Program Files, or AppData folders, just those pertaining to the product(s) with which they work... Perhaps you can request same from your IT group?



Has anyone tried this approach to changing the UAC settings for specific directories;

Code - Auto/Visual Lisp: [Select]
  1. (defun unlockdir ( dir uname / str )
  2.   (if (vl-string-search "(x86)" (setq str (vl-string-trim "Microsoft Windows NT Version" (getvar 'platform))))
  3.     (setq str (atof(vl-string-right-trim "(x86)" str)))
  4.     )
  5.   (if (> str 6.0)
  6.     (startapp (strcat "icacls " dir "\\ /T /E /G " uname ":f"))
  7.     (startapp (strcat "xcacls " dir "\\ /T /E /G " uname ":f"))
  8.     )
  9.   );defun
  10.  
  11. (unlockdir (vl-filename-directory (getvar 'menuname)) (getenv "username"))
  12.  

Any serious draw backs ?

Here is link to explanation -  http://ss64.com/nt/xcacls.html (http://ss64.com/nt/xcacls.html)

I just use these from the File Explorer context menu instead.

... This to Unblock one or more files at a time:

Code - Microsoft Registry: [Select]
  1. Windows Registry Editor Version 5.00
  2.  
  3. [HKEY_CLASSES_ROOT\*\shell\powershell]
  4. @="Unblock Files"
  5. "Extended"=""
  6. "HasLUAShield"=""
  7. "Position"="Bottom"
  8.  
  9. [HKEY_CLASSES_ROOT\*\shell\powershell\command]
  10. @="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe Unblock-File -LiteralPath '%L'"
  11.  


... And this to Take Ownership of a given folder:

Code - Microsoft Registry: [Select]
  1. Windows Registry Editor Version 5.00
  2.  
  3. [HKEY_CLASSES_ROOT\*\shell\runas]
  4. @="Take Ownership"
  5. "Extended"=""
  6. "HasLUAShield"=""
  7. "Position"="Bottom"
  8. "NoWorkingDirectory"=""
  9.  
  10. [HKEY_CLASSES_ROOT\*\shell\runas\command]
  11. @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
  12. "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
  13.  
  14. [HKEY_CLASSES_ROOT\Directory\shell\runas]
  15. @="Take Ownership"
  16. "Extended"=""
  17. "HasLUAShield"=""
  18. "Position"="Bottom"
  19. "NoWorkingDirectory"=""
  20.  
  21. [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
  22. @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
  23. "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
  24.  



I've had issues modifying the the default menu file, to add toolbars to it. 

Like my first comment above, you, or someone more qualified needs to effectively communicate how locking users out of all files/folders is actually hindering your ability to be more efficient/proficient. You're not asking for everything, and instead reasonably asking for only permissions to AutoCAD-related folders. Presented correctly, I cannot imagine why this would be an issue (and I'm also IT/Server admin!).

If they don't go for it, or have concerns, let me (us?) know... I'm certain we can help to clarify the legitimate need here, for them to properly assess within the confines of their Vogon-like policies. :-)

Cheers