Batch File
Results 1 to 7 of 7

Thread: Batch File

  1. #1
    Senior Member
    Join Date
    Dec 2002
    Posts
    275

    Batch File

    Is there a way to execute a batch file that needs root permissions on a limited account? I always install my programs and such with the right click run as tab. However it doesnt show up when i want to run one of my batch files. Thanks for your help. -dublix

  2. #2
    AO übergeek phishphreek's Avatar
    Join Date
    Jan 2002
    Posts
    4,325
    I don't think so. I've been doing a little messing around, and the only way I can get it to work is to give yourself permissions.

    Will it let you view the contents? If so, copy the contents and create a new .bat file that you will have permissions to. You can use the security tab in properties to set the permissions.

    Another thing I though of... If it requires admin privledges... copy it to disk, go to a machine that you have admin privledges on, modify the settings and you should be fine.

    It worked on my machines. I used a limited account on XP, and wasn't able to execute it.
    I copied to floppy, put it in a Win2k box and logged in admin/root. Modified the file, saved to disk with a different name, and put back on XP machine. The limited account was able to execute it now.
    Quitmzilla is a firefox extension that gives you stats on how long you have quit smoking, how much money you\'ve saved, how much you haven\'t smoked and recent milestones. Very helpful for people who quit smoking and used to smoke at their computers... Helps out with the urges.

  3. #3
    Banned
    Join Date
    Dec 2002
    Posts
    38
    to run something as a super user legitimately you would need super user permissions

  4. #4
    AO übergeek phishphreek's Avatar
    Join Date
    Jan 2002
    Posts
    4,325
    Another thing I just dreamed up... you can use the task scheduler to use the "run as" feature. Just create a job and run it as an admin.

    In older versions of M$, the task scheduler is also known as the at command in command prompt.
    Syntax:
    Code:
    The AT command schedules commands and programs to run on a computer at
    a specified time and date. The Schedule service must be running to use
    the AT command.
    
    
    AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
    AT [\\computername] time [/INTERACTIVE]
        [ /EVERY:date[,...] | /NEXT:date[,...]] "command"
    
    \\computername     Specifies a remote computer. Commands are scheduled on the
                       local computer if this parameter is omitted.
    id                 Is an identification number assigned to a scheduled
                       command.
    /delete            Cancels a scheduled command. If id is omitted, all the
                       scheduled commands on the computer are canceled.
    /yes               Used with cancel all jobs command when no further
                       confirmation is desired.
    time               Specifies the time when command is to run.
    /interactive       Allows the job to interact with the desktop of the user
                       who is logged on at the time the job runs.
    /every:date[,...]  Runs the command on each specified day(s) of the week or
                       month. If date is omitted, the current day of the month
                       is assumed.
    /next:date[,...]   Runs the specified command on the next occurrence of the
                       day (for example, next Thursday).  If date is omitted, the
                       current day of the month is assumed.
    "command"          Is the Windows NT command, or batch program to be run.
    It doesn't look like you can specify which credentials you want to use with the AT command, but you can using the Task Scheduler.
    Quitmzilla is a firefox extension that gives you stats on how long you have quit smoking, how much money you\'ve saved, how much you haven\'t smoked and recent milestones. Very helpful for people who quit smoking and used to smoke at their computers... Helps out with the urges.

  5. #5
    Senior Member
    Join Date
    Dec 2002
    Posts
    275
    Yes i can view the contents, but im on XP as well. I've been searching the internet lately looking for good sites on how to make batch files. I found a bunch of them that i liked but i dont like to run on root, and its kind of a hassle to switch over to my root account everytime i want to execute one of them. Thanks for responding guys i appreciate it.

  6. #6
    AO übergeek phishphreek's Avatar
    Join Date
    Jan 2002
    Posts
    4,325
    I know that some people will disagree with me, but...

    On a home network...
    If you are an experienced M$ user, and have good virus protection (up2date) and a firewall that is properly configured... I don't see anything wrong with working in admin/root on a local machine. After all, you are the "super user". Now, if you don't know what you are doing, then I wouldn't recommend this.

    I mean... on Win9x, you are super user all the time. What did you learn on? Chances are it was a 9x box, and how many times did you already learn from your mistakes?

    On networked machines that are important, like a file server and etc. I would not recommend this.

    On linux, I never log in as root unless I need to. Thats why su is so great.

    If you really don't like to login as root/admin...

    Why don't you do this... create a folder strictly for your .bat files and set the permissions on it so the child folders inheret the permissions and include your user name, or a group that you belong to. Then you won't run into these problems, unless the .bat file is making changes or accessing parts of the computer that would normally be restricted to a less privledged user.
    Quitmzilla is a firefox extension that gives you stats on how long you have quit smoking, how much money you\'ve saved, how much you haven\'t smoked and recent milestones. Very helpful for people who quit smoking and used to smoke at their computers... Helps out with the urges.

  7. #7
    Antionline Herpetologist
    Join Date
    Aug 2001
    Posts
    1,165
    One other thing that ouccured to me was to use a C program that goes something like this:

    Code:
    #include <stdlib.h>
    int main()
    {
    system("Path and Name of Batch File");
    return 0;
    }
    Compile. And use Run As...
    It might seem like overkill, but it'll work.

    Also, Phishphreak: I agree with you there, but only if you're an experienced/power user.
    Cheers,
    cgkanchi
    Buy the Snakes of India book, support research and education (sorry the website has been discontinued)
    My blog: http://biology000.blogspot.com

Posting Permissions

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