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

    • The Start menu is a defining UI element that made Windows, well, Windows. naturally people will be worked up to any changes it receives.
    • I believe voice assistants have reached a dead end in terms of usability. You can only do so much with voice. Even Google is sidelining Google Assistant for Gemini. Once you can no longer shoehorn "AI" everywhere, the industry will move on to the next fancy trend try to push voice assistants to use that tech.
    • Gemini in Google Sheets can now generate fully editable charts by David Uzondu Back in January, Google introduced a feature in Google Sheets powered by Gemini that lets you ask the AI to create charts from your data. The problem was, these charts were just static pictures, slapped on top of your cells. You could not edit them, and they would not update if your data changed. Now, the company has upgraded the feature so you can edit the charts however you want, plus they stay synced with your data as it changes. The process is quite straightforward. You use the Gemini side panel and just type what you want, like "create a bar chart showing campaign performance by market." Gemini then builds the chart, and when you insert it, the chart appears in a completely new tab within your spreadsheet. From that new home, you have total control. You can change the title, tweak the colors, and adjust all the little details just like any normal chart you would build yourself. It is not a completely perfect system, however. The biggest catch is that the editable chart is linked to the data in that new tab, not your original data source. So if you want the chart to reflect new numbers, you have to update the data in the chart’s dedicated tab. This is a bit of a weird detour from how standard Sheets charts have always worked, where they update directly from the source cells. For certain, more complex chart types, Google also notes that Gemini might still fall back to spitting out a static image, so your mileage may vary. The full rollout began recently, with Google expecting it to reach everyone within one to three days. This update is available for a bunch of Google Workspace accounts, including Business Standard, Business Plus, Enterprise Standard, and Enterprise Plus. It is also included for anyone with a Google One AI Premium plan, which the company has since renamed to Google AI Pro and Ultra. If you are on one of the old Gemini Business or Enterprise add-ons that Google stopped selling back on January 15, 2025, you get this feature too. Just make sure your admin has the "Smart features and personalization" setting turned on, or none of this will work.
    • iOS feature updates are lacklustre. I know it’s difficult with a mature OS, but imagine the announcements without Liquid Glass. Pretty thin.
  • Recent Achievements

    • Week One Done
      IAMFLUXX earned a badge
      Week One Done
    • One Month Later
      Æhund earned a badge
      One Month Later
    • One Month Later
      CoolRaoul earned a badge
      One Month Later
    • First Post
      Kurotama earned a badge
      First Post
    • Collaborator
      Carltonbar earned a badge
      Collaborator
  • Popular Contributors

    1. 1
      +primortal
      506
    2. 2
      ATLien_0
      268
    3. 3
      +FloatingFatMan
      237
    4. 4
      +Edouard
      201
    5. 5
      snowy owl
      162
  • Tell a friend

    Love Neowin? Tell a friend!