Debug Classic ASP with Visual Studio

https://weblogs.asp.net/dixin/debugging-classic-asp-with-visual-studio

Advertisements

PowerShell show Path Environment Variables

found here:  ilovepowershell.com/2010/05/27/how-to-find-your-system-path-using-powershell-and-environment-variables/

by Michael Simmons

PS C:> cd env:

PS Env:> ls path

And out comes the entry for the path variable

NAME                         VALUE
——                          ——-
Path                          C:\windows\system32;C:\;C:\Sysinternals…

The path environment variable has 2 properties:

KEY
VALUE

You see here that “Name” is actually an alias for “Key”.

PS Env:\> ls path | gm

TypeName: System.Collections.DictionaryEntry

Name          MemberType    Definition
—-          ———-    ———-
Name          AliasProperty Name = Key

(other methods and noteproperties)

Key           Property      System.Object Key {get;set;}
Value         Property      System.Object Value {get;set;}

If you want to see the actual value (what the path is), try this:

PS Env:> (ls path).value

If you want to see the individual lines in the path:

PS Env:> (ls path).value.split(“;”)

How many characters are in YOUR entire path statement?  Find out!

PS Env:> (ls path).value.length

How many entries are in your path statement?

PS Env:> ((ls path).value.split(“;”) | measure).count

Just list the entries in the path that are in the windows directory and below:

(ls path).value.split(“;”) | ? {$_ -like “C:\Windows*” -or $_ -like “%systemroot%*”}

Git for Windows tip: setting an editor

Update: But if you just want PowerShell to call npp.bat and pass the filename you want to edit in as a parameter use:

"C:/Program Files/Notepad++/notepad++.exe" -multiInst -notabbar -nosession -noPlugin %1
and remove the line
#!/bin/sh
Then from PowerShell you can enter:
npp myfile.ext
-cjf

danlimerick

The first time I tried to do git commit onmsysgit with no commit message (no –m switch), it opened up Vim so that I could write my commit message. Luckily for me I’d read enough Vim jokes on Twitter to know that :q or :q! would get me out. But there is no way I’d be able to actually write a commit message, save and quit in Vim (that’d probably take about 3 weeks of studying the documentation). Much easier to change the editor for git to Notepad++ or some other more familiar text editor.

The first step is to create a bat file (I called mine npp.bat) with the path to Notepad++ and the appropriate switches:

This opens a new instance of Notepad++ with no sessions or tabs or plugins which is what I want when writing a commit message. Place the bat file in the git subdirectory…

View original post 199 more words

Command Line Rename Files And Append To Front Of Name

Command Line Append:

for /f “tokens=*” %a in (‘dir *.tif /b’) do ren “%a” “LE2_%a”

Command Line Remove:

for %a in (LE2_*.tif) do ren “%a” ”    *.tif”     (note: There are 4 spaces in front of *.tif)
for %a in (    *.tif) do ren “%a” %a     (note: There are 4 spaces in front of *.tif)

In a batch file (replace % with %%):

for /f “tokens=*” %%a in (‘dir*.tif /b’) do ren “%%a” “LE2_%%a”

 

We Got Hacked By… Bingbot?

Actual line from server log file (host ip and domain name altered):

Line 6618: 2017-01-30 21:12:44 W3SVC923663 WEB728 123.123.123.123 GET /companies.asp remove=1723 443 – 157.55.39.69 HTTP/1.1 Mozilla/5.0+(compatible;+bingbot/2.0;++http://www.bing.com/bingbot.htm) – – http://www.website.com 200 0 0 24266 352 2515

Web application written using classic asp on IIS7 with SQL Server and hosted remotely.

  • No robots.txt.
  • Forced login only on the index.asp page.
  • All other pages don’t check for authorization.
  • All pages include navigation.asp.
  • Search.asp has <a href=’search.asp?selection=’all”>search all</a>.
  • Companies.asp has <a href=’companies.asp?remove=123′>delete</a>

True story. Today.