Selasa, 24 November 2015

A-Z List Windows Command

Alphabetical listing of commands:

Reg delete

Deletes a subkey or entries from the registry.

Syntax

Reg delete <KeyName> [{/v ValueName | /ve | /va}] [/f]

ParameterDescription
<KeyName>Specifies the full path of the subkey or entry to be deleted. To specify a remote computer, include the computer name (in the format \\ComputerName\) as part of the KeyName. Omitting \\ComputerName\ causes the operation to default to the local computer. The KeyName must include a valid root key. Valid root keys for the local computer are: HKLM, HKCU, HKCR, HKU, and HKCC. If a remote computer is specified, valid root keys are: HKLM and HKU.
/v <ValueName>Deletes a specific entry under the subkey. If no entry is specified, then all entries and subkeys under the subkey will be deleted.
/veSpecifies that only entries that have no value will be deleted.
/vaDeletes all entries under the specified subkey. Subkeys under the specified subkey are not deleted.
/fDeletes the existing registry subkey or entry without asking for confirmation.
/?Displays help for reg delete at the command prompt.

The following table lists the return values for the reg delete operation.
ValueDescription
0Success
1Failure

To delete the registry key Timeout and its all subkeys and values, type:
REG DELETE HKLM\Software\MyCo\MyApp\Timeout
To delete the registry value MTU under HKLM\Software\MyCo on the computer named ZODIAC, type:
REG DELETE \\ZODIAC\HKLM\Software\MyCo /v MTU

Reg add

Adds a new subkey or entry to the registry.


reg add <KeyName> [{/v ValueName | /ve}] [/t DataType] [/s Separator] [/d Data] [/f]
 
ParameterDescription
<KeyName>Specifies the full path of the subkey or entry to be added. To specify a remote computer, include the computer name (in the format \\<ComputerName>\) as part of the KeyName. Omitting \\ComputerName\ causes the operation to default to the local computer. The KeyName must include a valid root key. Valid root keys for the local computer are: HKLM, HKCU, HKCR, HKU, and HKCC. If a remote computer is specified, valid root keys are: HKLM and HKU.
/v <ValueName>Specifies the name of the registry entry to be added under the specified subkey.
/veSpecifies that the registry entry that is added to the registry has a null value.
/t <Type>Specifies the type for the registry entry. Type must be one of the following:
REG_SZ
REG_MULTI_SZ
REG_DWORD_BIG_ENDIAN
REG_DWORD
REG_BINARY
REG_DWORD_LITTLE_ENDIAN
REG_LINK
REG_FULL_RESOURCE_DESCRIPTOR
REG_EXPAND_SZ
/s <Separator>Specifies the character to be used to separate multiple instances of data when the REG_MULTI_SZ data type is specified and more than one entry needs to be listed. If not specified, the default separator is \0.
/d <Data>Specifies the data for the new registry entry.
/fAdds the registry entry without prompting for confirmation.
/?Displays help for reg add at the command prompt.

  • Subtrees cannot be added with this operation. This version of reg does not ask for confirmation when adding a subkey.
  • The following table lists the return values for the reg add operation.
ValueDescription
0Success
1Failure
  • For the REG_EXPAND_SZ key type, use the caret symbol ( ^ ) with %" inside the /d parameter

To add the key HKLM\Software\MyCo on remote computer ABC, type:
REG ADD \\ABC\HKLM\Software\MyCo
To add a registry entry to HKLM\Software\MyCo with a value named Data of type REG_BINARY and data of fe340ead, type:
REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead
To add a multivalued registry entry to HKLM\Software\MyCo with a value name of MRU of type REG_MULTI_SZ and data of fax\0mail\0\0, type:
REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail\0\0
To add an expanded registry entry to HKLM\Software\MyCo with a value name of Path of type REG_EXPAND_SZ and data of %systemroot%, type:
REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d ^%systemroot^%
 

Get SID of user

In Windows environment, each user is assigned a unique identifier called Security ID or SID, which is used to control access to various resources like Files, Registry keys, network shares etc. We can obtain SID of a user through WMIC USERACCOUNT command. Below you can find syntax and examples for the same.
Get SID of a local user
wmic useraccount where name='username' get sid
For example, to get the SID for a local user with the login name  ‘John’, the command would be as below
wmic useraccount where name='John' get sid
Get SID for current logged in user
To retrieve the SID for current logged in user we can run the below command. This does not require you to specify the user name in the command. This can be used in batch files which may be executed from different user accounts.
wmic useraccount where name='%username%' get sid
Get SID for current logged in domain user
Run the command ‘whoami /user’ from command line to get the SID for the logged in user.
Example:
c:\>whoami /user
USER INFORMATION
----------------
User Name      SID
============== ==============================================
mydomain\wincmd S-1-5-21-7375663-6890924511-1272660413-2944159
c:\>
Get SID for the local administrator of the computer
wmic useraccount where (name='administrator' and domain='%computername%') get name,sid
Get SID for the domain administrator
wmic useraccount where (name='administrator' and domain='%userdomain%') get name,sid

Jumat, 20 November 2015

Get current logged in user name command line (CMD)

In Windows OS, we can find the current logged in username from windows command line. The logged in user information is stored in environment variables. So just by printing the value in these environment variables we can get to know the login name.
To know the login name of the currently logged in user we can run the below command.
echo %username%
This works on all releases of Windows OS(Windows XP, Server 2003, Windows Vista and Windows 7).
There is another command whoami which tells us the domain name also.
whoami
Example:
c:\>whoami
cmdline\administrator
Both of these options to find user name can be useful in batch files to write code in such a way that it works for every user. For example, if your batch file need to access a user specific folder, say Application data, then you can refer the directory as ‘C:\users\%username%\appdata‘.

source: http://www.windows-commandline.com/current-logged-in-user-name-command/

Sabtu, 14 November 2015

Location of the Startup folder in Windows 8 / 10

The Startup folder in Windows contains a list of shortcuts of those applications that start when your Windows start. Earlier, you could easily access the Windows 7 startup folder from Start  Menu > Startup. But where is the Startup folder in Windows 10 / 8?

Windows 8 / 10 startup folder location

The Current Users Startup folder in Windows 8 is located at:
C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
These programs start up for the current logged in user only. To directly access this folder, open Run, type shell:startup and hit Enter.
Windows 8 startup folder location
Or to quickly open the folder, press WinKey, type shell:startup and hit Enter.

Startup folder in Windows 8 / 10

The All Users Windows 8 startup folder is located at:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
These programs start up for all users. To open this folder, bring up the Run box, type shell:common startup and hit Enter.
Startup folder in Windows 8
Or to open the folder quickly, you can press WinKey, type shell:common startup and hit Enter.
You can add shortcuts of the programs you want to start with you Windows in this folder.
You may use msconfig in Windows 7 or Task Manager in Windows 8 to manage startup programs. You can also delay Startup Programs or control the order in which they load, when Windows boots. This post on Windows Registry Startup Paths may also interest you.

source: http://www.thewindowsclub.com/startup-folder-in-windows-8

Senin, 09 November 2015

How to Set Up a Wireless Hotspot - From Ethernet (Windows 7)

Step 1: Enabling the Microsoft Virtual WiFi Miniport Adapter.





This step will guide you through enabling the "Microsoft Virtual WiFi Miniport Adapter": From my knowledge the "Microsoft Virtual WiFi Miniport Adapter" is not compatible with all wireless cards but if it yours is compatible, and you follow my guide, it will work.

To enable the Virtual adapter open the "Run" dialogue ("Windows key"+ "R")

Then open the Command Prompt (type in "cmd" and click "Enter")

Once CMD is open type in the following command:



netsh wlan set hostednetwork mode=allow ssid=Hotspot key=Password keyUsage=persistent



Where "Hotspot" is the SSID (the name of your connection) and "Password" is the password locking the connection.

Once this is done, you have enabled the Microsoft Virtual WiFi Miniport Adapter!




 Step 2: Configuring the Microsoft Virtual WiFi Miniport Adapter.



This step will guide you through configuring your newly set-up Microsoft Virtual WiFi Miniport Adapter.

This step will walk you through the process of creating a wireless hotspot using a pre-existing wired (ethernet)  internet connection.

To begin with, if it has not already been done, plug in an ethernet cable into your PC's Ethernet port. Then Navigate to "Network Connections" (From the Network and Sharing Center click on the "Change Adapter Settings" link in the top left hand corner. Enable the virtual adapter, if it is not already enabled, by right clicking on the adapter and pressing enable.  Once you have internet connectivity via the Ethernet cable and the virtual adapter is enabled, right click on the "Local Area Connection" button and click "Properties". Once the dialogue box pops up, click on the "Sharing" tab. From here click the check box labeled "Allow other Network Users to connect through this Computer's Internet Connection". Click on the Drop down box "Home networking connection" labeled "Select a private network connection" and select the Microsoft Virtual WiFi Miniport Adapter which should be labeled "Wireless Network Connection 2". Click "OK" and the "Local Area Connection" button should now say "Shared".


Step 3: Starting and Stopping the Wireless hotspot.



This final step will guide you through starting and stopping the wireless hotspot (access point).
It's time to go back to CMD.
Open a new CMD window ("Windows Key" + "R") and type in the following command:

netsh wlan start hostednetwork

CMD should confirm by saying "The hosted network started."
If you navigate back to the "Network Connections" window, you will notice the Microsoft Virtual WiFi Miniport Adapter should now have your SSID listed with full reception!

Now. To disable (turn off the hotspot), it is best to:
Open a new CMD window ("Windows Key" + "R") and type in the following command:

netsh wlan stop hostednetwork

CMD should confirm by saying "The hosted network stopped."
 And thats it! Your wireless hotspot will have started with the SSID (Name) and password you set! Try connecting to it with a different WiFi compatible device.

Thanks for reading and I hoped you learned from this as much as I did.


source:http://www.instructables.com/id/How-to-Set-Up-a-Wireless-Hotspot-Windows-7/?ALLSTEPS