Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Normally, after creating an executable as an alternate data stream, for instance:

type exec_this.bat > C:\blank.txt:exe.bat

one could simply say

start C:\blank.txt:exe.bat

to run the executable. In Windows 7, all I seem to get is "Access is denied." or "The system cannot find the file $WHATEVER_THE_FILE_IS."

How can I execute this batch file?

share|improve this question
    
This seems like a bad idea. What's your use case? –  uSlackr May 16 '11 at 21:48
add comment

1 Answer

up vote 4 down vote accepted

Windows 7 silently removed the ability to execute anything from an ADS. However, from the DOS command line, there are other options. For a batch file, you can execute line by line:

for /f "usebackq delims=φ" %i in (blank.txt:exe.bat) do %i

(Keep in mind, this does not actually execute the batch file into its own process, it simply reads and executes each line from the file. The φ symbol is typed with alt code number 2541. You want the delimiter to be a character you wouldn't ever use in the code.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.