none
Selected file is the input for my script RRS feed

  • Question

  • Hi guys!

    My knowledge about the powershell world is limited, so i don't know if what i'm asking you is possible.

    I've added an item on file context menu that call a script of mine, now i want that selected file become a parameter for my script.

    For example my script move an item to another folder but how can i tell to my script that rubrica.pdf is the file to move? Maybe the file can be a parameter?

    Thank for your time.

    A

    P.S.: Remember that i don't know what is the file in question or where it is so i must create a dynamic script.
    • Edited by Albiz Monday, September 15, 2014 7:34 AM
    Monday, September 15, 2014 7:27 AM

Answers

  • %1 is the full path of the item.

    Just like in batch files.

    Programname.exe "%1"

    The quotes account for spaces in the path.


    ¯\_(ツ)_/¯

    • Marked as answer by Albiz Tuesday, September 16, 2014 7:38 AM
    Monday, September 15, 2014 11:07 AM

All replies

  • %1 is the full path of the item.

    Just like in batch files.

    Programname.exe "%1"

    The quotes account for spaces in the path.


    ¯\_(ツ)_/¯

    • Marked as answer by Albiz Tuesday, September 16, 2014 7:38 AM
    Monday, September 15, 2014 11:07 AM
  • Hi jrv!

    Thanks it's perfect!

    A

    Tuesday, September 16, 2014 7:38 AM