If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
How to query
Just made a little batch file to find it doesn't run right without choosing right click and Run As Administrator. How do I set that so I can just double click instead. Changing Security settings didn't seem to matter. |
Ads |
#2
|
|||
|
|||
How to query
On 24/06/2015 03:26, pjp wrote:
Just made a little batch file to find it doesn't run right without choosing right click and Run As Administrator. How do I set that so I can just double click instead. Changing Security settings didn't seem to matter. It depends. If the batch file is supposed to start a Windows service of some kind then Administrator login is always required. Also, if the batch file is creating a file in some protected folder then again administrator user password is required. Apart from that, a batch file should run normally. Could you post the code here so that somebody can see if Admin privilege is required or not. If security is not a problem then why not change the profile to Admin user? This will solve everything instantly. Now security is there for a reason so think very hard before running everything as administrator. |
#3
|
|||
|
|||
How to query
|
#5
|
|||
|
|||
How to query
On 6/24/2015 8:16 AM, SC Tom wrote:
"pjp" wrote in message ... In article , says... On 24/06/2015 03:26, pjp wrote: Just made a little batch file to find it doesn't run right without choosing right click and Run As Administrator. How do I set that so I can just double click instead. Changing Security settings didn't seem to matter. It depends. If the batch file is supposed to start a Windows service of some kind then Administrator login is always required. Also, if the batch file is creating a file in some protected folder then again administrator user password is required. Apart from that, a batch file should run normally. Could you post the code here so that somebody can see if Admin privilege is required or not. If security is not a problem then why not change the profile to Admin user? This will solve everything instantly. Now security is there for a reason so think very hard before running everything as administrator. The 2nd line came from a post from another thread, thank you for whoever it was. ----------------- echo off VSSADMIN LIST SHADOWS pause ----------------- As said, just double click and VSSADMIN produces an error message, "Run As Administrator" and it doesn't. I have Administrator priveldges on account and it's the only account besides the "Administrtaor" account itself as "Guest" is turned off. I created a batch file using your exact wording, and it runs fine on mine- Win7HP x64. I also am the Admin on this PC. I changed the one line to "VSSADMIN LIST SHADOWS C:\Shadows.txt" (without the quotes) and removed Pause, and that worked, too. I don't know what would cause yours not to run correctly. also can add to Task Scheduler a task to run your batch, use "Run on Demand" without a timed schedule, and run with admin privileges. Then run that task from a shortcut. |
#6
|
|||
|
|||
How to query
In article , says...
On 6/24/2015 8:16 AM, SC Tom wrote: "pjp" wrote in message ... In article , says... On 24/06/2015 03:26, pjp wrote: Just made a little batch file to find it doesn't run right without choosing right click and Run As Administrator. How do I set that so I can just double click instead. Changing Security settings didn't seem to matter. It depends. If the batch file is supposed to start a Windows service of some kind then Administrator login is always required. Also, if the batch file is creating a file in some protected folder then again administrator user password is required. Apart from that, a batch file should run normally. Could you post the code here so that somebody can see if Admin privilege is required or not. If security is not a problem then why not change the profile to Admin user? This will solve everything instantly. Now security is there for a reason so think very hard before running everything as administrator. The 2nd line came from a post from another thread, thank you for whoever it was. ----------------- echo off VSSADMIN LIST SHADOWS pause ----------------- As said, just double click and VSSADMIN produces an error message, "Run As Administrator" and it doesn't. I have Administrator priveldges on account and it's the only account besides the "Administrtaor" account itself as "Guest" is turned off. I created a batch file using your exact wording, and it runs fine on mine- Win7HP x64. I also am the Admin on this PC. I changed the one line to "VSSADMIN LIST SHADOWS C:\Shadows.txt" (without the quotes) and removed Pause, and that worked, too. I don't know what would cause yours not to run correctly. I get a long error message basically telling me I don't have the priviledges if I just double click the bat file. I'd like to know how to change that seeing as right clicking the "bat" file and choosing Properties doesn't give me a tab for any option to ?Run As Admin? although the right click menu does. How do I set that permanently? |
#7
|
|||
|
|||
How to query
pjp wrote:
In article , says... On 6/24/2015 8:16 AM, SC Tom wrote: "pjp" wrote in message ... In article , says... On 24/06/2015 03:26, pjp wrote: Just made a little batch file to find it doesn't run right without choosing right click and Run As Administrator. How do I set that so I can just double click instead. Changing Security settings didn't seem to matter. It depends. If the batch file is supposed to start a Windows service of some kind then Administrator login is always required. Also, if the batch file is creating a file in some protected folder then again administrator user password is required. Apart from that, a batch file should run normally. Could you post the code here so that somebody can see if Admin privilege is required or not. If security is not a problem then why not change the profile to Admin user? This will solve everything instantly. Now security is there for a reason so think very hard before running everything as administrator. The 2nd line came from a post from another thread, thank you for whoever it was. ----------------- echo off VSSADMIN LIST SHADOWS pause ----------------- As said, just double click and VSSADMIN produces an error message, "Run As Administrator" and it doesn't. I have Administrator priveldges on account and it's the only account besides the "Administrtaor" account itself as "Guest" is turned off. I created a batch file using your exact wording, and it runs fine on mine- Win7HP x64. I also am the Admin on this PC. I changed the one line to "VSSADMIN LIST SHADOWS C:\Shadows.txt" (without the quotes) and removed Pause, and that worked, too. I don't know what would cause yours not to run correctly. I get a long error message basically telling me I don't have the priviledges if I just double click the bat file. I'd like to know how to change that seeing as right clicking the "bat" file and choosing Properties doesn't give me a tab for any option to ?Run As Admin? although the right click menu does. How do I set that permanently? What you want is a Self-Elevating script. http://blogs.technet.com/b/elevation...ng-script.aspx The average user in the group here, probably has their primary user account as "belonging to the Administrators group". Mine is that way on the Win7 laptop. If you create and log in with some sort of limited-user or guest account, I don't know if UAC is going to allow self-elevation. If you don't want to grant full administrator, there are "sub-groups" that an account can belong to. For example, if I have an account with low privileges, I can add the user to the "Backup" group, and then, that person will be able to run Macrium Reflect to back up all the partitions on the hard drive. I don't know what VSSAdmin belongs to, and whether some sub-group would be sufficient for that or not. A person who belongs to Administrators group, with UAC turned on, should see the appropriate warning dialog when a script attempts to run with elevated privileges. (Just as clicking "cmd" and selecting "Run As Administrator" should be prompting you.) So it's not like the operation is "quiet". There will still be a nag. And while you can disable UAC, that wouldn't be recommended. You should always have some idea when a program wants that level of privilege. If you download a program that sorts postage stamps, you would not expect that to run elevated, and you would "deny" it if the UAC prompt popped up. Treat newly downloaded programs with suspicion. Paul |
#8
|
|||
|
|||
How to query
In article ,
says... In article , says... On 6/24/2015 8:16 AM, SC Tom wrote: "pjp" wrote in message ... In article , says... On 24/06/2015 03:26, pjp wrote: Just made a little batch file to find it doesn't run right without choosing right click and Run As Administrator. How do I set that so I can just double click instead. Changing Security settings didn't seem to matter. It depends. If the batch file is supposed to start a Windows service of some kind then Administrator login is always required. Also, if the batch file is creating a file in some protected folder then again administrator user password is required. Apart from that, a batch file should run normally. Could you post the code here so that somebody can see if Admin privilege is required or not. If security is not a problem then why not change the profile to Admin user? This will solve everything instantly. Now security is there for a reason so think very hard before running everything as administrator. The 2nd line came from a post from another thread, thank you for whoever it was. ----------------- echo off VSSADMIN LIST SHADOWS pause ----------------- As said, just double click and VSSADMIN produces an error message, "Run As Administrator" and it doesn't. I have Administrator priveldges on account and it's the only account besides the "Administrtaor" account itself as "Guest" is turned off. I created a batch file using your exact wording, and it runs fine on mine- Win7HP x64. I also am the Admin on this PC. I changed the one line to "VSSADMIN LIST SHADOWS C:\Shadows.txt" Answer is use a shortcut to the bat file and give it "Run As ..." rights works. Oh, I'm on Win7 Home Pre maybe 64 bit works differently? |
#9
|
|||
|
|||
How to query
"pjp" wrote in message ... In article , says... In article , says... On 6/24/2015 8:16 AM, SC Tom wrote: "pjp" wrote in message ... In article , says... On 24/06/2015 03:26, pjp wrote: Just made a little batch file to find it doesn't run right without choosing right click and Run As Administrator. How do I set that so I can just double click instead. Changing Security settings didn't seem to matter. It depends. If the batch file is supposed to start a Windows service of some kind then Administrator login is always required. Also, if the batch file is creating a file in some protected folder then again administrator user password is required. Apart from that, a batch file should run normally. Could you post the code here so that somebody can see if Admin privilege is required or not. If security is not a problem then why not change the profile to Admin user? This will solve everything instantly. Now security is there for a reason so think very hard before running everything as administrator. The 2nd line came from a post from another thread, thank you for whoever it was. ----------------- echo off VSSADMIN LIST SHADOWS pause ----------------- As said, just double click and VSSADMIN produces an error message, "Run As Administrator" and it doesn't. I have Administrator priveldges on account and it's the only account besides the "Administrtaor" account itself as "Guest" is turned off. I created a batch file using your exact wording, and it runs fine on mine- Win7HP x64. I also am the Admin on this PC. I changed the one line to "VSSADMIN LIST SHADOWS C:\Shadows.txt" Answer is use a shortcut to the bat file and give it "Run As ..." rights works. Oh, I'm on Win7 Home Pre maybe 64 bit works differently? Possibly, but I wouldn't think so. I have an old Win7HP x86 drive on a shelf somewhere. If I find it, I'll plug it in and give it a try. -- SC Tom |
Thread Tools | |
Display Modes | Rate This Thread |
|
|