Help on scripts please

the-keeperthe-keeper New Zealand
edited May 2010 in Science & Tech
My friend has challanged me to create a script that will autorun and fill folders on your desktop with shortcuts to spider solitair but have a simple over ride, can someone help me on this one??? =] thanks :rockon:

Comments

  • clifford_cooleyclifford_cooley Arkansas, USA Member
    edited May 2010
    Errrr - What is the point in having multiply shortcuts to the same simple game?
  • QCHQCH Ancient Guru Chicago Area - USA Icrontian
    edited May 2010
    And if it's a challenge from a friend, us helping you learn to script is kind of cheating. I'll give you a hint. GOOGLE Batch Scripting and copy function. Scheduled task.... BINGO, you have an automated copy script.
  • the-keeperthe-keeper New Zealand
    edited May 2010
    haha, thanks. im only new to this whole scripts thing, but i want to learn everything i can, any ideas where to start =]
  • the-keeperthe-keeper New Zealand
    edited May 2010
    i surprised at the quick resomnse too thanks =]
  • the-keeperthe-keeper New Zealand
    edited May 2010
    oh and, i dont mind cheating =]
  • QCHQCH Ancient Guru Chicago Area - USA Icrontian
    edited May 2010
    Download notepad++. Its a really good program that helps with programming.
    Create folder you want to put the shortcuts into.
    Find the location of the item you want to locate (solitare shortcut).
    Open notepad++
    Do a FOR loop for, say, 50 time iterations.
    Inside the FOR loop, COPY from where ever the shortcut is to where you want it.
    Save the file as, say, "funny.bat" WITH the quotes. Make sure it actually ends with bat not txt.

    Now that you have the script, you need to do one of two things. Either put the script in the "Startup" folder OR go fancy and have the script run on a schedule. To do that you need to find "Task Scheduler" and create a task that runs the script.
  • the-keeperthe-keeper New Zealand
    edited May 2010
    sorry, im being a bit slow with all this. havnt had much time to look for batch scripts copy function, and i couldnt find a download for notepad ++ (only had a quick look on their site) can you please suply me with links if possible? thanks, hope its not an inconvenience, as i said before i am only knew to this =]
  • the-keeperthe-keeper New Zealand
    edited May 2010
    nevermind about the notepad++ link, i foud one =] some help on this whole batch scripting tho? can you plz explain it to me, coz im a tad lost =]
  • kryystkryyst Ontario, Canada
    edited May 2010
    Can you please explain in a little more detail what you want it to do? Cuz if I'm reading what your saying in the first post. Sounds like you are trying to make a program that auto fills a folder with links to spider solitarie unless someone knows the secret key to break out of it. Which is just lame, childish and a complete waste of our time. Furthermore it violates the policies of this forum.

    Course if that's not what your trying to do please explain.
  • QCHQCH Ancient Guru Chicago Area - USA Icrontian
    edited May 2010
    If this is just fun between two friends, cool. If you are looking to learn a bit about scripting, cool. If you are expecting us to write the code for you, not cool. If you expect to pimp someone with this and really make yourself annoying using this script, not cool.

    I gave you a GREAT start. I did the logic part for you. Use google and the things I mentioned. "Windows Batch Script For Loop"

    One possible stating point...
    <code>FOR /L %i IN (1,1,5) DO (
      ECHO Start of Loop
      ECHO %i
    )
    </code></pre>  The 1,1,5 is decoded as:
      
    <code>(start,step,end)
    </code></pre>  Also note, if you are embedding this in a batch file, you will need  to use the double percent sign (%%) to prefix your variables, otherwise  the command interpreter will try to evaluate the variable %i prior to  running the loop.
    
  • the-keeperthe-keeper New Zealand
    edited May 2010
    ok, thanks for all the help guys, i will try to make something outa all this =]
    and just so you know, im not making this with malicious intent, as qch said its just fun between friends, and i want to learn a bit about scripting.
    again, thanks for all the help
  • the-keeperthe-keeper New Zealand
    edited May 2010
    copy %SystemRoot%\system32\spider.exe c:\
    FOR /L %%i IN (1,1,5) DO (
    ECHO Start of Loop
    ECHO %%i

    this is what i have so far, im not to sure on how to use the loop, but the copy works just fine.
  • clifford_cooleyclifford_cooley Arkansas, USA Member
    edited May 2010
    Have fun and good luck. At the moment it will only place 6 shortcuts to spider solitaire on desktop. If you need it to do more you will have to figure it out for yourself. :)

    Copy Spider.zip
  • PacifistoPacifisto Turnip Extraordinaire Michigan Icrontian
    edited May 2010
    Looks like you're on the right track with the copying, but it has to be inside the loop - after the for...do( part. Though looking back on it, you're copying the actual exe, which is not a shortcut. You'll need a different command.
  • clifford_cooleyclifford_cooley Arkansas, USA Member
    edited May 2010
    Unless a shortcut exist, you may find you need to create one first. Shortcut's can not be created from commandline unless you have a third party utility. I included such a utility in my last post as well as code that will create 6 shortcuts on Windows 7 Desktop. Special alterations may be required for other operating systems such as the location and name of spider.exe.

    I spelled it all out, you should not have any problem figuring out what is what. After all, I learned what I know by reading work from others.
  • the-keeperthe-keeper New Zealand
    edited May 2010
    thank you clifford_cooly , i diddnt actualy realise that you included that in your last post, thanks a bunch =] however i was hoping that things could be explained to me a bit better rather than handed straight to me. if i dont know what each part of the script does i get lost.

    in response to Pacifisto: what would the command be for the shortcut?
    and how do i put it inside the loop?
  • the-keeperthe-keeper New Zealand
    edited May 2010
    sorry clifford_cooley i have just realised that you actualy included instructions, thanks that will help alot =]
  • PacifistoPacifisto Turnip Extraordinaire Michigan Icrontian
    edited May 2010
    As to the command, I don't know what it is, sorry. It shouldn't be hard to Google it, though...

    And to put it inside the loop, just make sure it's after do( - try on the next line.

    But I'm not really qualified to weigh in on this. I've never done any scripting myself, just plain ol' programming.
This discussion has been closed.