In that script I could copy these files into the start menu that is unique to the user.Įcho d|xcopy "C:\ptc\startup_scripts_3\Creo 3 Software" "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Creo 3 Software" /y /r /s /e This script sets up folders and cache location etc. That's to move that command from the install script to my post install script I have the users run. There is another option, that would remove the necessity to "Run as Admin". ![]() After fixing that syntax, the script completed and worked as expected. The script was actually exiting before it completed. ![]() My problem ended up being a syntax error in the script before it got to the xcopy line. I appreciate all the ideas that were floated. "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" >nul 2>&1Įcho Elevated Administrative privileges are requiredĮcho Set UAC = CreateObject^("Shell.Application"^) > "%TEMP%\getadmin.vbs"Įcho UAC.ShellExecute "%~s0","",","runas",1 > "%TEMP%\getadmin.vbs" I don't recall where I got the following code fragment, buthave used it to elevate a batch file using VBS on-the-fly. Use this command to see what is allowed by any Group Policies: Symbolic links caneven reference network locations. Using this approach, you don't have to mess with the permissions under ProgramData. Mklink /D "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Creo 3 Software" "C:\ptc\startup_scripts_3\Creo 3 Software" But any future updates to the source in C:\ptc\startup_scripts_3 will not, and the contents will be visible an accessible as if they existed under C:\ProgramData\. What about creating a junction or symbolic link between those two folders?Ĭreating this will still require elevated admin rights. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist. You may also use "Start a topic" button to ask a new question. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. This thread is inactive and closed by the PTC Community Management Team. If I run it as a batch file it doesn't work even if I use "Run as Administrator"Īnyone know how to make this work consistantly? Or, how to open up the permissions to the start menu folder so a normal human can put files in there using a batch file? If I run the command interactively in a command shell it works. My issue is the Run as Administrator trick was working. So, if you don't run the batch file using "Run as administrator", the script will not place the required files in the start menu. Surprisingly, moving files into this location requires elevated permissions. "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\" But, if you just open a command shell, or run a batch file, that process will not have elevated privileges. This means that if you use "run as admin" to start a batch file or open a command shell, that process will not be able to access any network shares. The only user that has full amin rights is the Administrator account, which runs everything elevated. ![]() So if you open a command shell while logged in as an admin, it will not run with elevated permission.ģ. Also an account in the Administrators group still runs everything not explicitly elevated as a limited user. Consequently a script you start using "Run as administrator", will not see mapped drives.Ģ. In Windows 7 elevated and non-elevated accounts are not linked, so they don't share the same drive mappings. If I open up a command shell the command works.ġ. My issue is most of the time it doesn't do it. echo d|xcopy "C:\ptc\startup_scripts_3\Creo 3 Software" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Creo 3 Software" /y /r /s /e rem ** Move shortcuts to the Windows Start menuĢ. Instead of cluttering the user's desktop with shortcuts I move a whole folder structure of shortcuts to the windows start menu folder.ġ. I'm trying to solve a problem with my install script.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |