Recommended Posts

I know it isn't secure, but it is the best thing I have right now, so, here it goes...

I need to be able to run a file as an admin in a batch file (i.e. runas /u:Administrator "%blahblah%.exe").

The runas command built into Windows doesn't support this, but I know I've seen apps that do support this. Anyone know of any that are free?

Remember, the entire thing is command line. Thanks for the help :D

Link to comment
https://www.neowin.net/forum/topic/655262-command-line-runas-with-password/
Share on other sites

  Hurmoth said:
I know it isn't secure, but it is the best thing I have right now, so, here it goes...

I need to be able to run a file as an admin in a batch file (i.e. runas /u:Administrator "%blahblah%.exe").

The runas command built into Windows doesn't support this, but I know I've seen apps that do support this. Anyone know of any that are free?

Remember, the entire thing is command line. Thanks for the help :D

Hmm I dont have any free utilities. We use the program run as professional here and it does command line and batch file.

Is this what your looking for -- it allows password on the command line

http://www.softtreetech.com/24x7/archive/53.htm

Not sure if its free or not - but you can download from this page, and it seems to run just fine, etc.

edit: Here is some info you might be interested in as well

http://www.commandline.co.uk/sanur/

Free Runas Alternatives

* CPAU Runas alternative supporting encoded passwords.

* LSrunas/LSRunase Console based Runas alternatives, the latter supports encoded passwords.

* AutoIt (v3) Scripting language for automating the Windows GUI.

* SuperExec GUI that encrypts passwords using Windows cryptography API's

BTW the AutoIT would get my vote --- its a tool any admin should have access to.

  XgD said:
But if the other option is to have the password in plaintext in the batch file
But there were many options give than allow you to encode/encrypt the password so that its not plain text, or you could turn the batch into an exe so they can not clearly read the password, etc.

There are other ways to obscure the password in a batch file, /savecred is cut and dry the user can run anything they want without even knowing anything just click use saved credentials.

Off the top a simple method would be to just turn your batch file with the commands in it to a exe. XP comes with the tool IExpress that can do this.

Or you use one of the many free batch to exe converters out there, etc.. etc.

+Budman's right. AutoIt makes this easy (for XP anyway):

; Are we already admin?
If Not IsAdmin() Then
	RunAsSet($CmdLine[1],'' , $CmdLine[2])
	Run( $CmdLine[3]  )
	Exit
EndIf

Save this script as BatchRunAs.au3 (or whatever) and compile it to an executable with Aut2Exe. Then in the batch file just add the line

BatchRunAs.exe <Username> <Password> Command

If required the username, password and the program to be run can all be hard coded (change the CmdLine[] parameters in the above script), before converting to an exe.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • You can sync bookmarks and tabs across all your devices using other browsers as well, that's not a feature exclusive to Google Chrome. So, if that's your reason to use Google Chrome on Android specifically, you have a narrow view of the world. You can use practically any browser these days and all of them will support sync.
    • I just made an account on 0patch I'm going to for 5 years in advance My fully loaded Acer aspire 7 (2019) will live up these 5 years in ease Laptop is not glued, there are about 20 screws to open it, I can maintain it with ease, no soldered memory or so, I clean it up every 6 months, I'l last for maybe another 8 years
    • Microsoft Teams gets a much needed health dashboard for admins by Usama Jawad Microsoft Teams is one of the most widely used tools for online collaboration and communication, especially in enterprise environments. This also means that any problem with the software has the potential to impact many customers and workflows. Up until now, the Teams troubleshooting process was fairly manual and cumbersome, but Microsoft is now looking to resolve this issue with a new "Teams client health" dashboard for admins. If a Teams instance now faces any kind of disruption, Teams administrators and helpdesk teams can use this dashboard to proactively diagnose and resolve the problem, rather than waiting for a disgruntled user to come to them with incomplete information. Microsoft says that Teams client health is focused on providing actionable insights that actually do require administrator input, surfacing actual issues that cannot self-heal, and highlighting persistent problems rather than one-offs. The Redmond tech firm has highlighted several scenarios where the Teams client health dashboard can enhance productivity with minimal disruption to workflows. One example is dealing with customers who are experiencing crashing issues in Teams. Rather than engaging in a manual process that involves asking them to reproduce the issue, you can simply leverage the health dashboard to spot problematic spikes and then remediate them yourself (as a Teams admin) through the provided mitigation guide. Similarly, another scenario involves monitoring and auditing if people within your organization are using the latest version of Teams. Right now, this is a very manual process, but with the health dashboard, you get these insights directly, including details about potential issues that might be blocking Teams updates. As expected, the Teams client health dashboard is available for admins and helpdesk teams within the Teams Admin Center. Still, Microsoft has encouraged customers to bookmark a direct link to the dashboard for easier recurrent navigation.
    • Fact that microsoft needs to explain why.. that prooves that they kinda failed with win 11.......... like Vista
    • they are putting so many **** but even like that its still better than move to 11 i guess
  • Recent Achievements

    • Reacting Well
      pelaird earned a badge
      Reacting Well
    • Mentor
      The Werewolf went up a rank
      Mentor
    • First Post
      Myriachan earned a badge
      First Post
    • Week One Done
      DrRonSr earned a badge
      Week One Done
    • Week One Done
      Sharon dixon earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      609
    2. 2
      ATLien_0
      218
    3. 3
      +FloatingFatMan
      169
    4. 4
      Michael Scrip
      158
    5. 5
      Som
      148
  • Tell a friend

    Love Neowin? Tell a friend!