Autoit script run bat file


















So you would embed the password, then do a RunAs and pass those credentials to the script. Look at the example for RunAs in the help file.

For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. How to get your question answered on this forum!

I found this on the forum. Use SciTE to compile the code into an exe so it hides account info. This doesn't embed the program you wish to install, just points to it with admin credentials.

So, then your script would look something like this assuming the setup executable is in the same directory as your script :. Your users would simply have to double click your script and let it run. If you want to further simplify, you could use FileInstall to embed the setup executable into your script file, so they have only one executable to click on.

JLogan, can you please explain the FileInstall? I have a similar sitituation as Jerry that I need to deploy an MSI ran from a command prompt with token information. Right now I have setup with a batch command to start the setup. Top Posters In This Topic 18 9 4 3. DarkMatter 0 Posted April 3, Monamo 4 Posted April 3, Posted April 3, Not sure why?

MadBoy 3 Posted April 3, MHz 80 Posted April 3, Danny35d 16 Posted April 3, Still not having any joy even with that code. Scan works because I can run it manually if i click the batch file myself. Hey Man, I run batch files like this all the time Edited April 3, by digibuddha. Can you show me how you would create your batch file?. I'm really getting nowhere fast with this one. Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community.

As Randy said, what are you trying to do with the script? There may be a better way to do this instead of reinventing the wheel, so to speak. Rockn the bat will only run as the system account during a start up or shutdown script in GPO if using a login or logoff this is runs as the current user if I am not mistaken.

This is to run on a domain pc, that is out of the office and stranded unable to connect back into the domain unless I can run 2 commands in an elevated command prompt. I just need to make something that I can send over to the user, that he can run, that will run the 2 commands and allow his PC to establish the connect back to the network. Execute it from the shortcut. AutoIT is free and you can compile this to. I could solve this in 1 minute by just telling him the password and send him a bat file with the commands to run.

It would still need to be present. If you tell us what changes are being made in the batch, I can write it into the autoit script and you wont need the batch. And it can all be compiled as one exe. Basically all this does it elevate a command prompt, then tell it to run your batch file. But we can change it so that it runs the commands you have in the batch instead.

I would think your only option would be to do a a runas command bat with your commands and convert that to an exe. I agree that AutoIt is probably the way to go. I have had to use it in the past and the RunAs function seemed to work nicely for me instead of sending the keystrokes. I have tried the following items installAdmin Func installAdmin ; Change the username and password to the appropriate values for your system.

Then I found and tried this. CreateObject "WScript. Shell" WshShell. Run "runas. Sleep WshShell. Thanks so much for any assistance!!! Link to post Share on other sites. Jos 2, Posted January 8, Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote. Moderation Team.

Nine 1, Posted January 8, Not much of a signature but working on it Posted January 8, edited. Dana 32 Posted January 8, Why are you using a function for a few simple lines of code? Once I extract the ZIP file to a user PC that does not have admin rights and I run the script created about I get an error "Batch file has not run, the system cannot find the file specified" When I click ok on that it then runs the file, but then I get an alert that I do not have the proper permissions and I need to run the file as "Run as Administrator" So really, the script didn't do anything I was hoping for.

Did I just go about this the wrong way? Put RequireAdmin as the very first line of the script.



0コメント

  • 1000 / 1000