Wednesday, June 3, 2020

Thursday, October 24, 2019

Enable/Disable Firewalls:



This is how you do it using a command prompt:
To Turn Off:
NetSh Advfirewall set allprofiles state off
To Turn On:
NetSh Advfirewall set allprofiles state on
To check the status of Windows Firewall:
Netsh Advfirewall show allprofiles


If you want to allow the only ping from outside computers use this setup


File and Printer Sharing (Echo Request - ICMPv4-In) -- Enable

File and Printer Sharing (Echo Request - ICMPv4-In) -- Enable

Wednesday, September 11, 2019

Windows_Commands_Daily

/####################################################################\
Remove the text starting from a delemeter ( here it is comma) till end in MS Excel

=LEFT(B1,FIND(",",B1)-1)


/###################################################################\/###################################################################\

First, search with regular expression:

open the "Replace" dialog (Ctrl+h, or menu Search -> Replace).
select the "Regular expression" radio button in the bottom-left of the dialog.
Now, fill the following search fields:

Find what: @.*$
Replace with: (leave empty)
This will find the text @ followed by any number of characters .* to the end of the line $ (end of line part is optional).

The found text is then replaced by nothing (or whatever you want to put in the "Replace with" field).


Similarly to delete the text before a delemeter
Find what: .*@
Replace with: (leave empty)

Note: here delemeter is ' @ '




/###################################################################\/###################################################################\

I searched all around but couldn't find any solutions.

I have:

<option value="1">Advertising
<option value="11">Aerospace
<option value="12">Agriculture
<option value="13">Architecture/Urban Planning
<option value="14">Arts
<option value="15">Automotive
<option value="16">Banking
<option value="17">Biotech & Pharmaceuticals
<option value="18">Business Services
<option value="19">Chemicals
I want delete all of text before the "> so the unnecessary text like <option value="1"> will be gone, only the Job type name such as Advertising being kept. How can I do it?


Use a regular expression search.

Type ctrl-H to open the search-and-replace dialog.
Make sure that "Regular expression" is checked.
Put this in the "Find what" box: ^[^>]*>
Make sure that "Replace with" box is empty
Click on "Replace All"
Done!

Explanation: The regular expression can be broken down as follows:

^ — match the start of a line
[^>] — match any character that is not the > character
* — repeat the previous as many times as possible
> — match a > character


Sunday, August 25, 2019

Auto create folder based on filename and move the file into its folder


This is a Windows batch script that creates folders for each file in the current folder that the script is running. The folders are created with folder names that follow the filenames. After creating the folder, it will move the file into its own folder. This batch script is particularly useful in organizing files into its own folder.

Step 1: Copy the Windows batch code below into your notepad and save it with filename "organize.bat".

@echo off
for %%i in (*) do (
 if not "%%~ni" == "organize" (
  md "%%~ni" && move "%%~i" "%%~ni"
 )
)

Step 2: Copy organize.bat file to the folder where there are files that you want to organize each file to be copied into a folder which has the same name as the filename.

Step 3: Double click organize.bat file and watch the magic begins.