3

A pipeline takes the output of one command and uses it as the input to another command.  So there are two problems with what you tried. The cd command doesn’t produce any output1. file * doesn’t take any input.  You might say, “Of course it takes input; it reads (part of) all the files.”  But it doesn’t read standard input.  If you type file *, it just runs ...


3

Objects under ~\AppData\Local\Microsoft\WindowsApps are not files – they are execution aliases, implemented through reparse points. They're a bit like symlinks or junctions, in that they they only point to another file within a specific application package, although they include some additional metadata about the package and they only support being executed ...


2

Yes it could be evidence of a virus or malware Yes you may be able to get back the command prompt by doing the following: Run powershell as admin Run the command sfc /scannow It will repair missing or corrupted system files.


1

A quick idea is to use Get-ChildItem with the -Directory and -Recurse options and use Start-Process and its -ArgumentList option to execute the python script passing it the full directory path. 1. Simple script (use to test specific folder(s)) $src = "C:\Folder\Path"; (Get-ChildItem $src -Directory -Recurse).FullName | % { Process { Start-...


1

I was able to get the result that (I guess) you want, sticking to CMD, but breaking your monster command into multiple steps, with an intermediate file: copy/y nul %temp%\out1.txt FOR /F "tokens=1 delims= " %P IN ('FINDSTR /M /I /R /C:"STATE.*=.*3" * ') DO (FINDSTR /I /S /C:"TCPHOST" %P) >> %temp%\out1.txt For /F "...


1

cat file.sh | mongo … is UUOC, <file.sh mongo … is better. Side note: why .sh? It doesn't matter to mongo or whatever, but people will expect file.sh to be a shell script. From now on I'm using file1 instead. man 1 mongo gives an example: mongo script1.js script2.js script3.js, so I expect mongo … file1 to work as well. #!/path/to/mongo or #!/usr/bin/env ...


1

A solution I hadn't initially considered before I posted this question is to check the file exists before calling start, as follows: if exist example.exe ( start example.exe ) else ( echo Error: 'example.exe' does not exist 1>&2 ) Strictly speaking, not a direct answer to my question as I originally stated it, but nonetheless serves my ...


1

General information The quoting in your code is very wrong. Important information: An unquoted variable undergoes word splitting and filename generation. Quotes that appear from variable expansion are not special to the shell that expanded the variable. There are two shells: the shell that interprets the script and the shell running in a container. Each ...


Only top voted, non community-wiki answers of a minimum length are eligible