Question: The requirement I've got is pretty straightforward, but I'm struggling sifting through the huge amounts of unrelated information on the subject.

**Requirement**

I have files synchronised between my PC and my web server. Basically I need to be able to right click on a local file and copy the equivalent server path (with some additional string manipulation logic) to the clipboard.

**Approach**

I guess what I need done is the following:

1. Add a Windows Explorer context menu option to execute a WSH script passing the full file path and name as a parameter.
2. Create a Windows Scripting Host script that will accept that paramater, do necessary string manipulation, and copy to clip board.

The string manipulation I can handle fine (preferably in VBScript). It's the whole passing a parameter to the WSH script that I can't really find any info about.

Alternately, I wouldn't mind if this was done with PowerShell (if applicable) so that I can learn a bit more about it while I'm at it.

Many thanks in advance.

Answer: 
You can access a parameter in VB script thus:

```
WScript.Echo(WScript.Arguments(0))

```

When you register a shell context menu command, you can pass the path and filename as a parameter by registering:

```
wscript.exe "C:\...full path...\myscript.vbs" "%1"

```
No need to use any script at all

set the Default value of key 
HKEY\_CLASSES\_ROOT\*\shell\Copy Server Path\Command
to:
cmd.exe /c echo "%1"|clip

Job done...
Have a nice day
PS I got this from <http://www.askvg.com/registry-tweak-to-add-copy-as-path-option-in-files-and-folders-context-menu-in-windows/>