No announcement yet.

Copy a file to an XP users desktop after unzipping

  • Filter
  • Time
  • Show
Clear All
new posts

  • Copy a file to an XP users desktop after unzipping

    I want to copy a go.pif file or other startup file to an
    XP users desktop after installing all files to a folder
    using WinZip (which is optional) so the user can click on it
    to start my program. In earlier Windows a simple
    shell "copy \windows\desktop ..." worked fine.
    I don't want to use a full installation program
    like Inno because they are bigger than what I'm copying.
    I can now use PB/DLL or PB/CC for the installation program
    that is now written in DOS. The installation program
    in DOS was simply inside the WinZip self extractor.
    Perhaps just using Inno is the solution.


  • #2
    Locating the desktop folder is best done with a Windows app, but eveb if you locate it successfully, it might not be possible for your app to deposit a shortcut there anyway due to policy/right restrictions.

    Inno would certainly be the easiest way to deal with this unless you want to write some Windows code. That said, the code for locating the desktop folder and creating a shortcut can be readily found on this BBS.

    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    mailto:[email protected]


    • #3
      Search for? (Shortcut to desktop?) Thanks.



      • #4
        try this one:

        if you are using pb/cc 3.0 or pb/win 7.0 then the calls to coinitialize() and couninitialize() are not required as the compiler does these operations automatically.

        powerbasic support
        mailto:[email protected][email protected]</a>
        mailto:[email protected]


        • #5
          This should work in Windows 2000 and XP....


          From there, you may wish to write a small routine
          that checks between the backslashes for long foldernames
          and truncates then appropriately.

          For example, the above would return

          E:\Documents and Settings\Amos Vryhof\DESKTOP

          PowerBASIC won't like this, and SHELL probably won't either.

          What you would want is E:\DOCUME~1\AMOSVR~1\DESKTOP

          Either way, this might not work due to permissions and such
          as Lance stated above, but should get you the information you
          are looking for.

          mailto:[email protected][email protected]</A>