Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Run AS administrator  (Read 4265 times)

0 Members and 1 Guest are viewing this topic.

yedija

    Topic Starter


    Greenhorn

    • Experience: Beginner
    • OS: Unknown
    Run AS administrator
    « on: September 03, 2012, 06:23:51 AM »
    I have a batch file contains xcopy command and I want to put it on startup so every time user logos The batch file will run by itself automatically without user has to click
    I have read a lot of forum and search thru google but I still can't find any solution that work for me.
    I have win 7 as my OS and have administrator right for the user account.
    One of solution i found on the web say  that make the batch file into a shortcut and go to the properties -> advance -> cek list the run as administrator -> OK. This solution work only if we manually click the shortcut, cuz startup won't run the shortcut.

    How do I make batch file run as administrator and able to run by itself every time the user login to windows
     
    Thanks

    TechnoGeek

    • Guest
    Re: Run AS administrator
    « Reply #1 on: September 03, 2012, 10:18:57 AM »
    I think you can do this through the task scheduler, checking 'run as administrator' and 'run when user logged in' on the appropriate option pages.

    yedija

      Topic Starter


      Greenhorn

      • Experience: Beginner
      • OS: Unknown
      Re: Run AS administrator
      « Reply #2 on: September 03, 2012, 06:46:19 PM »
      is there any other way other than task schedule ?

      TechnoGeek

      • Guest
      Re: Run AS administrator
      « Reply #3 on: September 03, 2012, 06:59:09 PM »
      Unfortunately, because of the way the restrictions on elevation are, users must accept a prompt for programs to get admin rights. Because the task scheduler runs as a system service, it has more freedom on what it can do, which includes creating elevated processes and executing as different accounts, all without user interaction. You COULD, of course, turn UAC off, but that's generally a bad idea.

      Bottom line: The only ways I know to get automatic admin access are disabling UAC and using the task scheduler. If anyone knows a different way, please say so. I would love to know also as it has been a problem for me in the past.

      hartbeatmr



        Apprentice

        Thanked: 54
        • Yes
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 7
      Re: Run AS administrator
      « Reply #4 on: September 03, 2012, 09:37:52 PM »
      Good evening yedija and welcome to CH

      I think this is exactly what you want to do http://www.tek-tips.com/viewthread.cfm?qid=1670171

      Please let us know if it works for you, Mike 
      Statement of the day.  The IT person asked. What kind of computer do you have and the customer replied a white one why?

      Dos_Probie



        Newbie

        • Experience: Beginner
        • OS: Unknown
        Re: Run AS administrator
        « Reply #5 on: September 04, 2012, 03:15:33 PM »
        Yedija,
        You did not post your batch file that you want to run on logon so I can't comment on that, but to add to logon to run automatically for W7 do the following:  8)
         
        1.Create a Run folder in your system32 and add rename your xcopy file to Copy.cmd and then add it to the Run folder.
        2.Then run copy and paste the below code to text file and rename to copy.reg


        Windows Registry Editor Version 5.00
        ;Add Batch File at Startup (Msconfig)
        [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
        "Copy"="C:\\Windows\\System32\\Run\\Copy.cmd"



        yedija

          Topic Starter


          Greenhorn

          • Experience: Beginner
          • OS: Unknown
          Re: Run AS administrator
          « Reply #6 on: September 07, 2012, 08:08:01 AM »
          Hi dos_probie,

          My batch file contain simple command
          net time \\server-01 /set /y
          xcopy \\server-01\RPT C:\RPT /A /Y /I /D /R /S
          xcopy "\\server-01\Update Files\" "C:\Program Files\Integrity Solution\Integrity Accounting\" /A /Y /I /D /R /S


          Dos_Probie



            Newbie

            • Experience: Beginner
            • OS: Unknown
            Re: Run AS administrator
            « Reply #7 on: September 07, 2012, 11:08:16 AM »
            Again you can test this, just use your exsisting .cmd file for updating workstations and place it in a run folder in system32 , then run the .reg file on each workstation to enter into registry for startup, then when users  log on it should run automatically.You can add a nul on copy to hide the copy of files over as well. 8)