The problem is that the file you're trying to execute has an alternate file stream that indicates that it came from the Internet. To make the message go away, you merely need to delete the stream. Sysinternals has a free utility called streams.exe that can easily do this for you. (It is important to note, as indicated in the message, that if the file did come from the public Internet, you should be cautious when executing it and make sure you understand completely what it's going to do.)
Once you have streams.exe, the command will be:
streams.exe -d C:\nst\win7.ps1
Viewing the alternate stream from the command line can be tricky, however, notepad++ can open them. On my system, the command would be:
"c:\Program Files (x86)\Notepad++\notepad++.exe" "e:\temp\test.ps1:Zone.Identifier:$DATA"
Also, if you're curious, the stream giving you all the grief contains:
[ZoneTransfer]
ZoneId=3
Defined ZoneIds are:
Local machine = 0
Intranet = 1
Trusted = 2
Internet = 3
Restricted = 4
If you run stree.ps1
in PowerShell like this:
stree some_argument
then your stree.bat
should look like:
PowerShell -Command "stree some_argument"
See the documentation for more details.
Edit: I haven't tested it, but I assume you would pass the arguments in the same way as with any other batch script:
PowerShell -Command "stree %*"
and then run:
stree.bat some_argument some_other_argument
Edit 2: Ok, I tested it and it works like expected.
Best Answer
Guys I've found a way just replace urusername with your username and run this command