Windows 10: How to run a batch file in admin mode from a user account?

Discus and support How to run a batch file in admin mode from a user account? in Windows 10 Support to solve the problem; I've created batch files to run the following commands to work around a particular problem: sc stop cldflt sc start cldflt The batch files work in my... Discussion in 'Windows 10 Support' started by Steve C, Nov 1, 2019.

  1. Steve C Win User

    How to run a batch file in admin mode from a user account?


    I've created batch files to run the following commands to work around a particular problem:

    sc stop cldflt
    sc start cldflt

    The batch files work in my user account if you right click and run them as Administrator.

    There are methods on the forum to run these batch files from a user account as a Task or using the runas command. I can't get these to work. What's the best way to run such batch files from a local account without been prompted for the admin password?

    :)
     
    Steve C, Nov 1, 2019
    #1
  2. djmcnz Win User

    running DOS as ADMIN

    I assume you don't have 'exit' anywhere in your batch file?

    Rather than playing with 'pause' - if you want to see the output...

    1. Open a command window as admin
    2. Run the batch file manually
    3. Command window will not close unless the 'exit' command is issued
    4. Read output
    That's the first step I'd take to diagnose. Then run every line in your batch file manually, one-by-one, in your admin command window (copy and paste from the actual batch file, don't retype the commands).

    You'll soon find your problem.
     
    djmcnz, Nov 1, 2019
    #2
  3. Bree Win User
    running DOS as ADMIN

    I suggested that in post #4 but @bromberg doesn't seem to have tried it yet...
     
    Bree, Nov 1, 2019
    #3
  4. Steevo Win User

    How to run a batch file in admin mode from a user account?

    Task Scheduler Batch file

    if you launch a batch file as any user it will launch in that users account.

    Create a batch that runs "dir" command and outputs it to a text file, that will be in said users account, and if it exists already it just reads the username from teh text file.

    I will tell you what you need to know, but I'm not doing it for you.
     
    Steevo, Nov 1, 2019
    #4
Thema:

How to run a batch file in admin mode from a user account?

Loading...
  1. How to run a batch file in admin mode from a user account? - Similar Threads - run batch file

  2. Admin and User account disabled

    in Windows Hello & Lockscreen
    Admin and User account disabled: I have a gaming PC with Windows 10 enterprise... I know very little about Computers and have been running windows XP up until two months ago when my PC died on me... Installed some games and one of them wanted access via the Administrator. So, I logged in for the very...
  3. Run oscdimg.exe from a batch file?

    in Windows 10 Installation and Upgrade
    Run oscdimg.exe from a batch file?: OK, I have a batch file that copies files from a mounted windows 10 installation file and updates drivers in boot.wim and install.wim. The thing I cannot work out is how to automatically run oscdimg.exe (command from deployment and imaging environment) in a batch file so I...
  4. Running an uneditable Batch file

    in AntiVirus, Firewalls and System Security
    Running an uneditable Batch file: Hi people, Got a task to run a certain CMD command on a number of PCs as administrator. So I thought i would create a batch file doing this. This is not the issue. The issue is that I am unable to lock down successfully so people cannot just edit the file to see the admin...
  5. How to change admin user account name?

    in User Accounts and Family Safety
    How to change admin user account name?: I am installing the 'Android sdk' software, however when I try select the 'SDK' path, it says something like 'android sdk should not contain whitespace'. I am wondering how I would change my name so it has no space so I can get my issue fixed 92477
  6. Windows 10: How change account from admin into limited user account?

    in User Accounts and Family Safety
    Windows 10: How change account from admin into limited user account?: Hello everybody, I have realized that all the laptops I installed Windows 10 in the last year (several family laptops) are running with Microsoft-Accounts which are Admin-Accounts. Now I read that this is a serious security issue. I would like to change these...
  7. Downgrading from a local Admin Account to a Standard User Account?

    in User Accounts and Family Safety
    Downgrading from a local Admin Account to a Standard User Account?: After reinstalling Windows 10, I created a local Admin user account just enough for me to install some apps and set things up. After that, I created another local Admin account. Now, I need to downgrade my current Admin account (which I created during setup) to a Standard...
  8. User Account changed from Admin to Guest

    in User Accounts and Family Safety
    User Account changed from Admin to Guest: Dear people of the Tenforums, I could use your advice. On Saturday I decided to give new Windows 10 (it picked Home Edition by itself) a try. Previous version was Windows 7. After a flawless install I have seen that something on my C: partition is using a lot of...
  9. Batch file that runs once for all new user accounts

    in Windows 10 Software and Apps
    Batch file that runs once for all new user accounts: Hey guys i need some help. I have an app called StartIsBack that i installed on our school computers. I want to do 2 things. First i want to add a registry key to the hkey current user key that copies the customized start menu settings when the user first logs on silently and...
  10. How to run batch file with powershell

    in Windows 10 Network and Sharing
    How to run batch file with powershell: I created a basic batch file that uses "net share" to share a local path. I saved the batch file. When I double click the file I get "access is denied"... note, I am logged on as a admin. Anyways... I figure it has to be run using power shell. I do not know much about...

Users found this page by searching for:

  1. batch file passing admin credentials