| 1. |
Solve : Semi-Adv questions. HELP!!? |
|
Answer» How do i get the batch file to support the drag and drop feature? Like, i want to be able to drag a file on to the batch and then it executes something like this: I mean when I drag a file on to the batch, I want it to be set as %smc% so I can use it like do you mean grab the file with you mouse and drop it onto the batch program. then no you CANT do that. Batch files are not capable of detecting mouse clicks or movement. Quote from: macdad- on August 07, 2008, 01:41:58 PM do you mean grab the file with you mouse and drop it onto the batch program. then no you cant do that. Batch files are not capable of detecting mouse clicks or movement. Macdad, do you ever check before you write? I really WISH you WOULD start doing that. It's not hard. The rest of us do it. If you don't, it's called "running your mouth", I think, in American English. It is not helpful on a forum like this. Create a batch file with this code in it Code: [Select]echo off echo %1 pause 1. Save it to a folder. 2. In Windows Explorer, drop a file or a folder onto it. 3. Tell us what happens. oh cool! it shows the file thanks!! Quote from: kaiyoken on August 07, 2008, 02:29:51 PM oh cool! it shows the file There you go... Dias 1 Macdad 0 ok, now I have a problem. when I drag the file over it works and all, but the directory is reset. meaning is no longer the current folder it set to "c:\documents and setting\user" instead PLEASE show your code Dias when i read this Quote How do i get the batch file to support the drag and drop feature? Like, i want to be able to drag a file on to the batch and then it executes something like this: i thought he ment grabbing the file from a folder and drop it on the batch window while it was running. so sorry for being a chatter box Quote from: macdad- on August 07, 2008, 04:17:16 PM i thought he ment grabbing the file from a folder and drop it on the batch window while it was running. Well, you're right there, you can't do that. here is my old one that works: echo off FOR /F "tokens=1*" %%G IN ('dir /b *.smc') DO Set smc=%%G If [%smc%]==[] goto filenotfound bin\movlm.exe %smc% bin\cutdrv.exe %smc% bin\cutsnd.exe %smc% pause goto end and here is the one im trying to make work >.> set %1 If [%1]==[] goto autofind goto process1 ---other part of code removed--- :process1 cls cd echo ===== cutting ===== bin\makesnd.exe %1 bin\importsnd.exe %1 echo ===== ------- ===== ping localhost -n 2 >Nul pause goto complete the line set %1 does nothing. What are you trying to do? You cannot "set" %1. It ALREADY has a value. hey i've posted first the example of dnd Code: [Select]set var=%1 If [%var%]==[] goto autofind goto process1 |
|