Accepting input to BAT file by dragging.

G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.customize (More info?)

How do I create a shortcut to a BAT file that will accept a file dragged
onto it.
I created a simple bat file "copyto.bat" which didn't work (containing):

@echo off
copy "%1" c:\xfer
copy "%1" c:\saves
exit

I then created a shortcut to it and modified the shortcut properties to
be:
C:\WINDOWS\Desktop\copyto.bat "%1"

When I drag a file onto the shortcut, it doesn't do the copy.
Does anyone have any suggestions or another way to do this?
(Win 2000 or XP)

Thanks.
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.customize (More info?)

Turn echo on and put a pause in it and read the error message.
Remove the %1 from the shortcut. Remove quotes in your bat file.
--
----------------------------------------------------------
'Not happy John! Defending our democracy',
http://www.smh.com.au/articles/2004/06/29/1088392635123.html

"nospam" <x@ray.com> wrote in message news:410D4C26.56A0357E@ray.com...
> How do I create a shortcut to a BAT file that will accept a file dragged
> onto it.
> I created a simple bat file "copyto.bat" which didn't work (containing):
>
> @echo off
> copy "%1" c:\xfer
> copy "%1" c:\saves
> exit
>
> I then created a shortcut to it and modified the shortcut properties to
> be:
> C:\WINDOWS\Desktop\copyto.bat "%1"
>
> When I drag a file onto the shortcut, it doesn't do the copy.
> Does anyone have any suggestions or another way to do this?
> (Win 2000 or XP)
>
> Thanks.
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.customize (More info?)

Tried your suggestion of removing the quotes in the command shortcut and
also the ones in the bat file. Still nothing. Tried putting a pause
command before the exit in the bat file. No window opens or anything.


David Candy wrote:
>
> Turn echo on and put a pause in it and read the error message.
> Remove the %1 from the shortcut. Remove quotes in your bat file.
> --
> ----------------------------------------------------------
> 'Not happy John! Defending our democracy',
> http://www.smh.com.au/articles/2004/06/29/1088392635123.html
>
> "nospam" <x@ray.com> wrote in message news:410D4C26.56A0357E@ray.com...
> > How do I create a shortcut to a BAT file that will accept a file dragged
> > onto it.
> > I created a simple bat file "copyto.bat" which didn't work (containing):
> >
> > @echo off
> > copy "%1" c:\xfer
> > copy "%1" c:\saves
> > exit
> >
> > I then created a shortcut to it and modified the shortcut properties to
> > be:
> > C:\WINDOWS\Desktop\copyto.bat "%1"
> >
> > When I drag a file onto the shortcut, it doesn't do the copy.
> > Does anyone have any suggestions or another way to do this?
> > (Win 2000 or XP)
> >
> > Thanks.
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.customize (More info?)

Describe what happens. We fixed your syntax errors. You may have added the %1 etc to try to overcome the initial problem. Try dragging onto the bat file and shortcut. The cursor should be showing for both that it will accept dropped files.

--
----------------------------------------------------------
'Not happy John! Defending our democracy',
http://www.smh.com.au/articles/2004/06/29/1088392635123.html

"nospam" <x@ray.com> wrote in message news:410DA980.3E4BF902@ray.com...
> Tried your suggestion of removing the quotes in the command shortcut and
> also the ones in the bat file. Still nothing. Tried putting a pause
> command before the exit in the bat file. No window opens or anything.
>
>
> David Candy wrote:
> >
> > Turn echo on and put a pause in it and read the error message.
> > Remove the %1 from the shortcut. Remove quotes in your bat file.
> > --
> > ----------------------------------------------------------
> > 'Not happy John! Defending our democracy',
> > http://www.smh.com.au/articles/2004/06/29/1088392635123.html
> >
> > "nospam" <x@ray.com> wrote in message news:410D4C26.56A0357E@ray.com...
> > > How do I create a shortcut to a BAT file that will accept a file dragged
> > > onto it.
> > > I created a simple bat file "copyto.bat" which didn't work (containing):
> > >
> > > @echo off
> > > copy "%1" c:\xfer
> > > copy "%1" c:\saves
> > > exit
> > >
> > > I then created a shortcut to it and modified the shortcut properties to
> > > be:
> > > C:\WINDOWS\Desktop\copyto.bat "%1"
> > >
> > > When I drag a file onto the shortcut, it doesn't do the copy.
> > > Does anyone have any suggestions or another way to do this?
> > > (Win 2000 or XP)
> > >
> > > Thanks.