Web Downloaded Code and Hidden Characters

Background

Stole one line from the Web and can not even get it to work

 

SMH Moment

Another SMH moment. What good is to steal something and yet not be able to use it.

 

Error

Here is the stupid error, I am getting

Error Message

Image

executed-with-special-characters-20170120_1242pm

Textual


>accessChk_sqlServer.cmd

>..\AccessChk ûp sqlservr.exe ûf ûq ûv

Explanation

  1. Basically the – operator is being substituted with û

Review Code

Here is the code when I type it out in the Console

Image

view-with-special-characters

Textual

>type accessChk_sqlServer.cmd
..\AccessChk ûp sqlservr.exe ûf ûq ûv

Explanation

  1. Basically the – operator is being substituted with û

 

Clean Up

Notepad++

Launch Notepad++ and opened the file

Original Display

notepadplusplus-display-20160120-0108pm

Change Encoding to OEM-US

Let us change Encoding to OEM-US.

Here are our steps:

  1. Click on menu items
    • Encoding
    • Character sets
    • Western European
    • OEM-US

 

changeencodingtooem_us

 

Post Change Encoding

notepadplusplus-display-20160120-0113pm

 

Replace & Strip Out Special Characters

Find & Replace

Using Find & Replace to replace û with –

notepadplusplus-display-20160120-0115pm

 

Find & Replace – Post

Post “Find & Replace

notepadplusplus-display-20160120-0116pm

Explanation
  1. Please attention to the count of how many replacements was done

 

Save

Please save the revised document

Thankfully notepad++ color codes changed documents.

BTW, by Color Code I mean a red disk icon by the file name.

notepadplusplus-display-20160120-0120pm

 

Run Script

With the saved changes, took back to the console and re-ran the script.

executed-without-special-characters-20170120_0122pm

Ran successfully.

 

Dedicated

Dedicated to Mark Russinovich & Notepad++.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s