faldo Posted April 22, 2010 Share Posted April 22, 2010 (edited) I've been searching for an hour now without finding an answer, it may be due to my lack of knowledge of correct words. Anyway, my question is if there's any way to create a script, compile it as console and send switches to to the script as variables. ie. The script called "addfolders.exe": For $i = 1 to $Switch DirCreate ( "c:\temp\FolderNr"&$i) next In CMD i want to type... addfolders.exe /10 ...to create 10 folders in that given directory. Edited April 22, 2010 by faldo Check out my other scripts: RDP antihammer/blacklist generator | Phemex cryptocurrency exchange API Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 22, 2010 Share Posted April 22, 2010 Command Line Parameters - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
faldo Posted April 22, 2010 Author Share Posted April 22, 2010 erhm... i'm not sure what you mean by showing me that you need to add quotes to a commandline with spaces... I need a similar function to ConsoleRead() but instead of typing: echo Hello! | ConsoleRead.exe i want to be able to type: ConsoleRead.exe /Hello! ...and get switch piped down to stdin somehow... i'm not that good at how it works :/ Check out my other scripts: RDP antihammer/blacklist generator | Phemex cryptocurrency exchange API Link to comment Share on other sites More sharing options...
faldo Posted April 22, 2010 Author Share Posted April 22, 2010 (edited) Never mind, problem solved... $CmdLine is the variable to use... thanx somdcomputerguy For those who need it, the script would look like this: For $i = 1 to $CmdLineRaw DirCreate ( "c:\temp\FolderNr"&$i) next[ and CMD command would be ScriptName.exe 10 ...to create 10 folders. Cheers! Edited April 22, 2010 by faldo Check out my other scripts: RDP antihammer/blacklist generator | Phemex cryptocurrency exchange API Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 22, 2010 Share Posted April 22, 2010 I'm glad you got it going. I'm not too good with words, so I'm glad that my cryptic post of just a link was good enough to help you. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now