none
A simple Question regarding an anomaly in my Powershell Code [Level = very easy] RRS feed

  • Question

  • Hello together,

    Following Problem i am trying to solve:

    I've create two files at the system drive c:\ with the name r1.txt and r2.txt.

    In both of those file i've written a unique text: file1 and file2 respectively.

     

    1. Now what i am trying is to swap those files, unfortunately, nothing changes ....

    my syntax is as followed:

    ${c:r1.txt},${c:r2.txt} = ${c:r2.txt},${c:r1.txt}

     

    2. How is it possible to swap files in an other directory. i.e C:\Users\Max\Desktop

    I've tried something like this: ${c:users:max:desktop:filename.txt} but it didnt work either.

     

    Thanks in advance guys and i hope i dont bother you!

    i also understand german.

    regards

    Powershell Junior

     



    • Edited by King Julien Wednesday, February 1, 2012 12:12 PM
    Wednesday, February 1, 2012 12:08 PM

Answers

All replies

  • The code you posted worked for me....

    1.

    2.

     

    Tested on a Windows 7 x64...


    Thanks, Wilson Souza - MSFT This posting is provided "AS IS" with no warranties, and confers no rights
    Thursday, February 2, 2012 8:33 AM
    Moderator
  • Closing this post.

    If you feel this wasn't answered, feel free to open a new thread on this topic


    Thanks, Wilson Souza - MSFT This posting is provided "AS IS" with no warranties, and confers no rights

    Tuesday, March 6, 2012 2:56 AM
    Moderator