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. Batch file with admin user name pre populated

    in Windows 10 Gaming
    Batch file with admin user name pre populated: I have a batch file that was wrote in power shell not mine it requires administrator credentials. Currently what happens is when I click on the file I get a message telling me I will need to enter credentials and to press any key. When I do that the Windows Command Processer...
  3. Batch file with admin user name pre populated

    in Windows 10 Software and Apps
    Batch file with admin user name pre populated: I have a batch file that was wrote in power shell not mine it requires administrator credentials. Currently what happens is when I click on the file I get a message telling me I will need to enter credentials and to press any key. When I do that the Windows Command Processer...
  4. Batch file with admin user name pre populated

    in AntiVirus, Firewalls and System Security
    Batch file with admin user name pre populated: I have a batch file that was wrote in power shell not mine it requires administrator credentials. Currently what happens is when I click on the file I get a message telling me I will need to enter credentials and to press any key. When I do that the Windows Command Processer...
  5. BATCH - Run as Admin from current path instead system32 folder.......

    in Windows 10 Support
    BATCH - Run as Admin from current path instead system32 folder.......: For order a my folder i have created a similar .bat files: Code: md A md B ... ... md Z move a*.* .\A move b*.* .\B .. .. move z*.* .\Z There's a big issue......... i need to run this batch as admin and i have used the command "Run as Admin" from context menu and i hope i...
  6. User Account Control and Admin Approval mode

    in Windows 10 Customization
    User Account Control and Admin Approval mode: In GPedit I set User Account Control: Run all administrators in Admin Approval mode to Disable, but that can be change by the User Account Control slider in the User Account Control Settings, how do I disable the slider function or make make the Approval mode read only. It...
  7. Programs running in Buit in Admin account but not in User Account having admin privileges

    in Windows 10 Installation and Upgrade
    Programs running in Buit in Admin account but not in User Account having admin privileges: Hi Support Team I am facing an issue for programs running properly in Built in Admin User Account however not in Self created User account having admin privileges. This issue occurs with many programs like 1. i Have to run many programs Setups .exe through cmd as...
  8. 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...
  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