6 Replies Latest reply on Oct 9, 2008 3:37 PM by fribergb



      I'm trying to push a Bat file using one line to copy files to a specific folder.:


      copy \\cfld1\packages\msp\*.qat "%USERPROFILE%\Local Settings\Application Data\microsoft\office\"


      Running the Bat locally works perfectly fine.


      Of course, instead of being copied into the logged in user's profile, it goes into LocalService.  Fine.  A policy push should supposedly take care of this(in my understanding) as long as the logged in user is in the Administrators group of the local machine.  Well, it didn't.  So now I'm asking for help.  What am I missing?


      Thanks All,



        • 1. Re: %USERPROFILE%
          MarXtar ITSMMVPGroup

          You don't mention what version of LANDesk you are using.  If you look at your delivery method, see if there is an option to run as the logged in user.  This should then allow you to access that environment variable.


          Mark Star - MarXtar LANDesk Enhancements

          Home of Power State Notifier & Wake-On-WAN for LANDesk

          • 2. Re: %USERPROFILE%

            Mark -


            Thanks for replying - we are on 8.7 Sp3 and I don't see the run as the logged in user in any of my policies.  I actually looked for that.  Thought I had seen in previously but I couldn't find it.  Anything else?  Your help is greatly appreciated.



            • 3. Re: %USERPROFILE%
              zman Master

              You will have to use startasuser http://community.landesk.com/support/docs/DOC-1575 I think it may be in sp3, if not download sp4 and grab it from the source. You can put it anywhere (local, remote share, etc...) and run it.

              1 of 1 people found this helpful
              • 4. Re: %USERPROFILE%

                Thanks Zman - I just got through some of the startasuser docs.  I've been bugging the person who is suppose to update to 8.8 for months now to upgrade.  I wouldn't be having this discussion if he had, apparently.  I'm going to give it a shot.  Aprreciate your help.



                • 5. Re: %USERPROFILE%

                  Thanks Zman - I managed to get startasuser to work.  I had to call a bat file from within the bat file.  But it worked.  I was using this to copy the QAT files that comprise the Quick Access Toolbars in Office 2007.  We wanted to set these up with standard, basic commands.  Thanks again.

                  • 6. Re: %USERPROFILE%

                    You might consider also using%appdata% instead of %userprofile%.


                    %appdata% always returns the value of WHERE the user's application data is currently running from... there are most likely many "Application Data" folders on a typical machine but only one will be the current location where the App Data is really stored.


                    For example, %UserProfile% usually always comes back to \documents and settings\username\ but %appdata% will point to where the Application Data is running out of, even if it's a temp folder on the C: drive...