TechSpot

Batch file

By trithumb
Feb 28, 2008
  1. alright im tryin to pull a prank on a classmate... i want to create a batch file to repeatedly copy a file or a folder to his desktop....

    start/min
    cd \
    cd c:\documents and settings\all users\desktop
    :loop
    md folder
    goto loop

    but once the folder has been created it wont make multiple i want it 2 fill his screen... my teacher assigned me this task n ive been fighting with it for 3 days now.... ne help would b awesome
     
  2. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

    start /min
    CD %allusersprofile%\Desktop-------------(actually not sure if you will see this, better to use %userprofile%)
    md loop
    :loop
    cd loop
    md loop
    goto loop


    I haven't tested it! (but it loops, I mean looks good)
     
  3. trithumb

    trithumb TS Rookie Topic Starter Posts: 77

    that worked but it just kept making sub folders... i want like 50 folders or files all over his desk
     
  4. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

    Oh!
    . ..
     
  5. trithumb

    trithumb TS Rookie Topic Starter Posts: 77

    if u have aim IM me my sn is trithumb
     
  6. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

    Or you could just

    copy %userprofile%\locals~1\tempor~1 %userprofile%\desktop

    Which copies all files from Temporary Internet Files to Desktop (in Xp)
    If you go to Start Run and type in shell:Cache (on any Windows) you'll see how much junk is in there.

    Anyway users should clean their Internet cache!
     
  7. trithumb

    trithumb TS Rookie Topic Starter Posts: 77

    says cant not find specified file
     
  8. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

    Doh, forgot *.*

    copy %userprofile%\locals~1\tempor~1\*.* %userprofile%\desktop

    Note there's a space after *.* (actually just copy and paste the line)

    Can you let me know if it works, because I still haven't tried it myself
    If you do try it on your own system (that DOES NOT have any other files on your own desktop)
    When finished, just click on Start --> Run-->Desktop
    And delete all the stuff

    Also this command presumes you have some Temporary Internet Files (most users have thousands)
     
  9. trithumb

    trithumb TS Rookie Topic Starter Posts: 77

    ok i made this

    start/min
    cd C:\Documents and Settings\trithumb\Cookies
    :loop
    copy *.txt c:\documents and settings\trithumb\desktop
    goto loop

    but for sum reason wen i type it through the promt i get a syntax error in the copy line i wana do a wildcard copy of all the cookies n throw them on his desktop

    and by the way the script u wrote had an error as well
     
  10. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

    It's because its a windows system (hidden) directory. Incredible temp won't work!

    Just use another folder, ie %windir%
    Also you are better off using the percentages to make it clean, ie:-

    Copy %windir%\*.* %userprofile%\Desktop
     
  11. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

    As per PM, I am replying again.

    call C:\MyFolder\CHOICE /T:N,3

    Note: The "MyFolder" refers to where-ever you have "choice" and your bat file

    Change the number 3 to whatever number you want (each number is a second ie 3= 3Secs)
     
     
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.