Jump to content

CMD executed Websait, prevent from happening

Poohl
Go to solution Solved by Windows7ge,
1 minute ago, Poohl said:

so there's no setting in the CMD, that filters enters (and prevents everything from executing).

I've played with the CMD for years now and as far as my knowledge goes there is not. It's not THAT sophisticated. Using a text editor you can add:

pause

or

exit

to prevent the execution of .bat files if they contain not so nice commands. Simply inputting commands strait into CMD it'll run through them so long as the commands are followed with execute/enter.

Hello,

I've accidentally copy + pasted an entire webpage full of commands into the cmd, and it automaticly executed itself, because it contained enters. I can't undo this, but my System is still running, so it seems like it is harmless.

My Question: Is there any way to prevent enters from being copied into the CMD, so this doesn't happen again.

Link to comment
Share on other sites

Link to post
Share on other sites

Have you tried copying the list of commands into a batch file then editing out the enter commands manually?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Windows7ge said:

Have you tried copying the list of commands into a batch file then editing out the enter commands manually?

no, I want that I can't accidentally copy enters into CMD.

Link to comment
Share on other sites

Link to post
Share on other sites

I want to prevent enters from being copied into the CMD.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Poohl said:

no, I want that I can't accidentally copy enters into CMD.

You stated that you got the list of commands off of a web page. Instead of putting them strait into a CMD session create a CMD.bat file, put the list in there then you can edit out the enters. It'll prevent this issue from occurring again.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Windows7ge said:

You stated that you got the list of commands off of a web page. Instead of putting them strait into a CMD session create a CMD.bat file, put the list in there then you can edit out the enters. It'll prevent this issue from occurring again.

so there's no setting in the CMD, that filters enters (and prevents everything from executing).

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Poohl said:

so there's no setting in the CMD, that filters enters (and prevents everything from executing).

I've played with the CMD for years now and as far as my knowledge goes there is not. It's not THAT sophisticated. Using a text editor you can add:

pause

or

exit

to prevent the execution of .bat files if they contain not so nice commands. Simply inputting commands strait into CMD it'll run through them so long as the commands are followed with execute/enter.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Windows7ge said:

I've played with the CMD for years now and as far as my knowledge goes there is not. It's not THAT sophisticated. Using a text editor you can add:

pause

or

exit

to prevent the execution of .bat files if they contain not so nice commands. Simply inputting commands strait into CMD it'll run through them so long as the commands are followed with execute/enter.

OK, well than that's it.

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Poohl said:

OK, well than that's it.

 

If you accidentally execute something that you shouldn't run you can also add (input before the commands):

timeout (-1 to 99999)

timeout -1 (System will wait indefinitely)

timeout  0 (System will wait 0 seconds)

timeout 99999 (System will wait 27hrs 46mins 39secs)

Link to comment
Share on other sites

Link to post
Share on other sites

23 minutes ago, Windows7ge said:

~~

Thanks, that might be helpful.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×