How to link cmd command output as next command input?

Viewed 33

I try to make automated .cmd installer, for few libraries. Let's say MSCOMCTL>OCX for example. It has to put one file from wherever it was downloaded, to syswow64 and register it with regsvr32 command. Code is simple:

cd %homedrive%%homepath%
dir MSCOMCTL.OCX /s /b > c:\dir.txt

then Im getting file dir.txt with one line with direct location of MSCOMCTL.OCX Next part is to somehow copy it from it's dir to syswow64 file but

C:\Users\[username]>type dir.txt  

types good location of one and only *.ocx file but both of

C:\Users\[username]>type dir.txt | xcopy c:\windows\syswow64 
dir MSCOMCTL.OCX /s /b | xcopy c:\windows\syswow64

doesn't work as well. I've lurked many of cmd code sites and no one wanted to link dir as source How to properly attach dir output as source to another command? If I'd know how to make it with one file, then i'll be good with other ones.

0 Answers
Related