A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: copy command in bat file

  1. #1
    Senior Member
    Join Date
    Aug 2003
    Posts
    325

    copy command in bat file

    is there anyway using northcodes proxy.exe to tell the user ive installed a url file to their favorites folder after the auto run has run.

    any help appreciated

  2. #2
    Senior Member
    Join Date
    Aug 2003
    Posts
    325
    copy "thetowngossip.url" "%homepath%\favorites"

    why doesnt this code point proxy.exe to install the file to the favorites folder from the cd am i missing a path

    it works off the desktop but not the cd

    any help appreciated

  3. #3
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Make sure the BAT file and the URL file are in the same location, otherwise you need to tell the copy command where the file is (right now you're using a relative path that says the URL file is in the same location as the BAT file).

  4. #4
    Senior Member
    Join Date
    Aug 2003
    Posts
    325

    files are in same location on cd

    all the files are in the cd root

    i think the autorun file is working but the bat file isnt doing its job.

    proxy.exe runs from the desktop but not from the cd with the line in the bat file

    should i use homedrive=c: in the line also ?

  5. #5
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    all the files are in the cd root
    ... and that's why it's not working when you call it from Flash.

    The external application (in this case the BAT file) must be in a subfolder named 'fscommand'. This subfolder must be in the same directory as the projector which uses the fscommand action. This security restriction helps prevent malicious use of the exec option.

    The following script launches the Windows BAT file somefile.bat, which is in the fscommand folder on the same level as the projector:

    on (release) {
    fscommand ("exec", "somefile.bat");
    }

    Note: The fscommand subfolder path is not used in the argument. Place somefile.bat inside the fscommand folder, but just use the name and extension of the application in the argument.

  6. #6
    Senior Member
    Join Date
    Aug 2003
    Posts
    325

    no i tried that

    my projector wasnt working i think the button didnt work when using the fscommand so i stopped using the projector to get the files working. now they are working i tried them on the cd with a .inf file to get them to autorun and i think they are but the file isnt going where it should

    autorun.inf file and projector are in the cd root

    [autorun]
    open=thetowngossip.exe which opens the projector

    projector has a button

    on (release) {
    fscommand ("exec", "thetowngossip.exe");
    }

    all of the following files are in fscommand folder on the cd which is in the cd root

    proxy file changed to thetowngossip.exe

    bat file changed to thetowngossip.bat and has the following instruction

    copy "thetowngossip.url" "%homepath%\favorites"

    file i want to put in favourits folder is the towngossip.url

    if i run all this from the desktop it works fine if i run it from the cd then it all works except the thetowngossip.url file doesnt get to the favourits folder i think the path is wrong

    any ideas
    Last edited by ogri; 02-15-2006 at 05:38 AM.

  7. #7
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    The "thetowngossip.url" file has to be in the fscommand folder where the BAT file is or it won't get found. If that doesn't fix the problem (or you're already doing that) then you might want to see what HOMEPATH is set to.

    On my machine the HOMEPATH variable is set to "\". Another one you can try is %USERPROFILE% which should point to something like "C:\Documents and Settings\Tim" and then you can tack on "\Favorites" to that.

  8. #8
    Senior Member
    Join Date
    Aug 2003
    Posts
    325

    can you believe it

    i copied the info from the bat file then deleted it then created another one then pasted the info back into it and bobs your uncle it worked first time.

    thanks for all your help northcode.

    and for proxy.exe great little app keep them coming

    thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center