Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Runas Batch File? (XP Pro SP2)

    Hello, I've just switched over to using a limited user account and I'm having trouble with my closing down batch file. Here is the line that is causing me the most problems

    call "C:Program FilesERUNTAUTOBACK.EXE" K:EruntBAK#Date# /days:14 /noconfirmdelete /noprogresswindow

    Erunt doesn't run properly and throws up an error. I looked for a way to launch the whole batch file as an administrative user but runas doesn't appear on the right click menu for batch files. How can I run a batch file in full admin mode from a LUA account?

    Thanks,

    Chris (Hunt)

  2. #2
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,413
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Re: Runas Batch File? (XP Pro SP2)

    Why are you CALLing an executable file, and not a BATch file?

    Presumably your AUTOBACK program needs to be run with Administrator privileges.

    Personally, I'd wait until I had Vista before I considered "switching over to using a limited user account". XP wasn't really built with this as a design goal.
    BATcher

    Time prevents everything happening all at once...

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Runas Batch File? (XP Pro SP2)

    <P ID="edit" class=small>(Edited by Cah on 10-Aug-08 22:48. Edited because forgot to make links live (got confused with using Thunderbird!))</P>Hi BATcher, I was hopeful when I got a reply but found your reply disappointing. I quoted one line from my saveDOWN.bat batchfile. Your question makes little sense to me. Do you mean I should use a different command other than "call". If so, what is better. I've been using that method for years. We can debate the merits of using a limited user account with XP but that doesn't answer my original question which is how to launch a Batch file and get it to run with administrative privileges. Perhaps my original post wasn't clear. What I mean was if I right-click on an exe file or link to an exe file I'm offered the option to use runas allowing me to launch the program with admin credentials. If I right-click on a batch file I don't see that option. Does that option exist for batch files in Vista? Is that what you meant by XP not being built with using a limited account as a design goal?

    I think the big problem with using a limited user account on XP is that for many years software writers were careless with their code. Old programs often grab more privileges than they need. I've been trying to use a LUA off and on for years. This is the first time I've not been driven back to an admin account within the first few hours of running one. Most of the software I'm running now seems to be compatible with LUA accounts. I guess because of updates or because I'm running new versions or different software . AUTOBACK.exe is similar to setting a restore point, it needs to access the registry and it is to be expected that it needs admin privileges.

    I think with recent developments running an admin account is now too risky with computers that connect to the internet. Before if one was careful the chance of getting hit with an infection was very small. Now even if one is careful, a visit to a single web page can be enough to get clobbered. There are just too many vectors of attack and the consequences of getting infected can be too grim. There's also a lot of info now about how to use limited user accounts with XP. Here are a couple of links for anyone who wants to follow up on the idea:

    http://homepage.mac.com/corrp/window...resources.html (list of links)
    http://blogs.msdn.com/aaron_margosis/archi.../17/158806.aspx (simple method)

    I don't think switching to Vista is a useful alternative. I read recently that some researchers have found a way to completely bypass the new security architecture completely. They haven't found a hole that needs to be plugged but rather a design flaw. See:

    http://searchsecurity.techtarget.com/news/...1324395,00.html

    The methods discovered may affect other operating systems as well and may not even be windows specific. Personally, I'd switch to Linux and start over before I'd ever start using vista.

    Cheers,

    Chris

  4. #4
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,413
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Re: Runas Batch File? (XP Pro SP2)

    I'm sorry you were disappointed by my reply. Let's try a bit harder!

    Is the information in http://technet.microsoft.com/en-us/l.../cc781769.aspx of any help?
    Similarly http://www.petri.co.il/forums/showthread.php?t=14375

    Of course yoiu can use CALL for an EXE file - I just wondered why you did; probably because your BATch file contains commands other than AUTOBACK.

    According to Mike Minasi, talking about Vista, "The GUI RunAs is dead. It doesn't exist any more. There is instead a very restricted "Run as administrator" which ISN'T a RunAs, it's just a request to the OS to use your WHOLE token rather than a restricted token."

    I'd do a bit more Googling with likely search terms like "XP runas administrator batch", and see if anything useful comes up.
    BATcher

    Time prevents everything happening all at once...

  5. #5
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Runas Batch File? (XP Pro SP2)

    Thanks for taking the trouble to find those links. I appreciate it. I'd half come across them already but your post encouraged me to look at them more closely. I've come to the conclusion that I'm going to need to write a close down routine using AutoHotKey. It seems runas just won't work nicely with regular batch files.

    Best wishes,

    Chris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •