Home / Microsoft / Microsoft DOS / help me (drag n' drop)
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2  All - (Bottom) Print
Author Topic: help me (drag n' drop)  (Read 1313 times)
Steve (Somebody)
Guest
« on: October 07, 2005, 01:52:40 PM »

 ??? how can i make a batch file that works with drag n' drop mode. i like wanna start a prog called sthing.exe and ex. it converts *censored*.* to wtf2.*, definetely with a different extension. so anyway how is that done, if possible? :)
IP logged
Sidewinder
Guru



Thanked: 97
Posts: 4,341

Experience: Familiar
OS: Windows 7

« Reply #1 on: October 07, 2005, 06:12:50 PM »

Drag n' Drop is a function of Windows not batch files. It also has to be written into a program to handle that feature. Is the sthing.exe file a windows program?

If not, you may be able to use redirection or the pipe, but again not all programs can handle this. Does sthing.exe accept command line parameters?

Need more information on your sthing program and please tell us your Windows version.

8)
« Last Edit: October 07, 2005, 07:03:20 PM by Sidewinder » IP logged

If you don't know where you are going, any road will get you there

                                                                            -Lewis Carroll
Steve (Somebody)
Guest
« Reply #2 on: October 08, 2005, 12:21:57 AM »

look, its the midp2exe.exe file that converts some games with the .jar extension for mobile phones to .exe 's to check them out first at the pc. the prog uses command line, yes, it works with the command "midp2exe -jar anyname.jar -out anyname.exe . im working under winxp. so is it possible? :)
IP logged
Sidewinder
Guru



Thanked: 97
Posts: 4,341

Experience: Familiar
OS: Windows 7

« Reply #3 on: October 08, 2005, 05:29:12 AM »

Anything is possible. Practical no, possible yes. This little snippet should help you out. Just replace path with the path to your jar files.

Code: [Select]

@echo off
for /f "tokens=1-2 delims=." %%i in ('dir path\*.jar /b') do (
     mid2pexe -jar %i.%j -out %i.exe
     )


Why anyone is still writing batch files, on a XP machine no less, is beyond me. But I'll leave that for another day.

Good luck.

8)
IP logged

If you don't know where you are going, any road will get you there

                                                                            -Lewis Carroll
Steve (Somebody)
Guest
« Reply #4 on: October 08, 2005, 08:22:43 AM »

actually its not like that, i just wanna learn everything. like having an unlimited database and i wanna asborb the most of the data in it. though they say.... the less you know, the better off you are. i dont believe it tho. a batch file is useful to me... i dunno how, but i think that by knowing it im gonna be better with everything related.
IP logged
Steve (Somebody)
Guest
« Reply #5 on: October 08, 2005, 08:28:11 AM »

well, doesnt work for me! :) anyway ill keep trying :) whats that /f thing anyway
IP logged
Sidewinder
Guru



Thanked: 97
Posts: 4,341

Experience: Familiar
OS: Windows 7

« Reply #6 on: October 08, 2005, 09:35:13 AM »

It would have been helpful if you had posted your batch file or the error. That /f thing is a switch telling the FOR statement you will be passing a file set, string or command. On an XP machine with command extensions enabled you can type for /? at any prompt for a full explanation of the FOR statement.

Hope this helps. 8)
« Last Edit: October 08, 2005, 09:56:50 AM by Sidewinder » IP logged

If you don't know where you are going, any road will get you there

                                                                            -Lewis Carroll
Steve (Somebody)
Guest
« Reply #7 on: October 09, 2005, 01:51:41 AM »

look ive made the batch file look like this:

Quote
@echo off
for /f "tokens=1-2 delims=." %%i in ('dir C:\Documents and Settings\Nassos\Desktop\MobileGames\*.jar /b') do ( midp2exe.exe -jar %i.%j -out %i.exe )


like u gave it to me simply with the directory. i think ive screwed it up, since i simply want it to use the directory it is already in :)
IP logged
Sidewinder
Guru



Thanked: 97
Posts: 4,341

Experience: Familiar
OS: Windows 7

« Reply #8 on: October 09, 2005, 05:59:28 AM »

Embedded spaces in a path are one of the pitfalls of long file names :o

Code: [Select]

@echo off
for /f "tokens=1-2 delims=." %%i in ('dir "C:\Documents and Settings\Nassos\Desktop\MobileGames\*.jar" /b') do ( midp2exe.exe -jar %i.%j -out %i.exe )


Note: if the batch file and jar files are in the same directory, you don't need a path at all for the DIR command.

Hope this helps. 8)
« Last Edit: October 09, 2005, 06:19:41 AM by Sidewinder » IP logged

If you don't know where you are going, any road will get you there

                                                                            -Lewis Carroll
Steve (Somebody)
Guest
« Reply #9 on: November 11, 2005, 06:13:39 AM »

still wont work for me. it's been a long time that i hadn't been here, though im back. i think that there might simply not be a sol for this 1. even though there's a solution for everything i terribly doubt it now :P
IP logged
Sidewinder
Guru



Thanked: 97
Posts: 4,341

Experience: Familiar
OS: Windows 7

« Reply #10 on: November 11, 2005, 03:58:19 PM »

A feature of Windows is that if you write a generic batch file for one file (use %1 as a file name), you can drag and drop any file onto the batch file and it will be processed. A more complicated method would be to use the SendTo feature of Windows.

Like I mentioned, drag 'n drop is a Windows feature, not meant for batch coding.

If you like batch files, you're gonna love the new Microsoft Script Host. (was for Vista, delayed until Exchange 12)
IP logged

If you don't know where you are going, any road will get you there

                                                                            -Lewis Carroll
Steve (Somebody)
Guest
« Reply #11 on: November 17, 2005, 02:21:34 PM »

so whadda u mean that i should stop looking into it or just use the command prompt, writing 10 words everytime?
IP logged
Sidewinder
Guru



Thanked: 97
Posts: 4,341

Experience: Familiar
OS: Windows 7

« Reply #12 on: November 17, 2005, 03:52:39 PM »

I'm not suggesting you stop looking into the problem. It would be most helpful if you could post the error message and the version of the batch file that produced it

Also let us know what directory the jar files are in, if that's where the batch file is and where the midp2exe.exe program lives. The problem appears to be either a typo or needing a fully qualified path to a file.

Let us know.  8)
IP logged

If you don't know where you are going, any road will get you there

                                                                            -Lewis Carroll
Steve (Somebody)
Guest
« Reply #13 on: November 18, 2005, 02:09:58 PM »

look

1) the midp2exe prog is in the same folder as the batch file and the jar files are in the same folder as well. now what im asking is simply take the jar file drag n' drop style and drop it on the batch and voila! the jar was converted to an exe using the midp2exe prog.
IP logged
Sidewinder
Guru



Thanked: 97
Posts: 4,341

Experience: Familiar
OS: Windows 7

« Reply #14 on: November 18, 2005, 04:34:45 PM »

Drag 'n Drop does not exist in DOS.

Code: [Select]

@echo off
for /f "tokens=1-2 delims=." %%i in ('dir *.jar /b') do (
mid2pexe -jar %i.%j -out %i.exe
)


You may have seen this code before. If it doesn't work, document (with the error messages) what went wrong.

8)
IP logged

If you don't know where you are going, any road will get you there

                                                                            -Lewis Carroll
Pages: [1] 2  All - (Top) Print 
Home / Microsoft / Microsoft DOS / help me (drag n' drop) « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.086 seconds with 20 queries.