Jump to content

Recommended Posts

Posted

I have a bunch of batch files with different content and I was wondering if there's a way to make an autoit program which does this,

accepts parameters such as mycommand parameter1 parameter2 parameter3 parameter4

and then does this:

paramater1 would be the batch file name, and the rest of the parameters would be for the batch file.

so

mycommand sharedrive.bat O

would execute this batch file which was already there:

net use %1: /delete
net use %1: \\sr2400-6\main\shares\payroll

(for example)... and also, doesn't allow the black command window to come up when it is executing.

in this way I would have an autoit command which basically runs a batch file for you, and doesn't make a black box open up on client computers when a batch needs to be written.

Posted (edited)

ok I'll look into how to do that... how do you accept parameters in autoit? like mycommand.exe /switch -option blah

etc? nvm I think I found it.

Edited by scythetleppo
Posted

hi, would that work with an unknown number of parameters, ranging from 0 to let's say 10?

how would it know? thanks

$CMDLINE[0] store the amount of parameters and the limit is something like 64 or so.

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. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...