Can't get File.Rename to work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • fsgenesis
    Indigo Rose Customer
    • Dec 2007
    • 9

    Can't get File.Rename to work

    Trying to rename files on the destination system but can't make it work.

    Here's what I'm using in the Post-install phase:

    File.Rename(SessionVar.Expand("%AppFolder%\\Scener y\Eurw\Scenery\HL945060.bgl", "%AppFolder%\\Scenery\Eurw\Scenery\HL945060.FSG")) ;

    It's throwing up an error when I run the installer:

    On Post Install, Line 1: 2 arguments required

    Can some one please point out my error?

    Thanks in advance

    Justin
  • fsgenesis
    Indigo Rose Customer
    • Dec 2007
    • 9

    #2
    No longer getting the 2 arguments error, but this isn't working either:

    File.Rename(SessionVar.Expand("%AppFolder%\\Scener y\Eurw\Scenery\HL945060.bgl"), (SessionVar.Expand("%AppFolder%\\Scenery\Eurw\Scen ery\HL945060.FSG")));

    just need to change the extension on some files.

    Arrghhh (as he beats his head against the wall)

    Justin

    Comment

    • fsgenesis
      Indigo Rose Customer
      • Dec 2007
      • 9

      #3
      Never mind. My head hurts but finally got this to work:

      File.Rename(SessionVar.Expand("%RenFolder%\\Scener y\\Eurw\\Scenery\\HL945060.bgl"), "%RenFolder%\\Scenery\\Eurw\\Scenery\\HL945060.FSG ");

      forgot my escape slashes

      Comment

      Working...
      X