DOS - NT - Windows TipsJust some notesThese are my personal notes that I use as a quick help in my work.
|
|
Sleep --> stores the information in RAM. This means that if power is
completely turned off, unsaved data is lost.
Hibernate --> saves the contents of memory into a physical file called
hiberfil.sys on disk.
In both cases, save all work to disk
Windows
[W] + m |
Minimize all windows |
[W] + M |
Maximize all windows |
[W] + e |
Windows explorer |
[W] + r |
"Run" dialog box |
[W] + f |
Search for files |
[W] + ^f |
Search for computers |
[W] + [pause] |
System properties |
[W] + v |
Show clipboard history |
Other characters: see chars.html
Special character keys for MS-office: see Section on MS-Office
The location of "send-to" in Windows 7: C:\Users\{username}\AppData\Roaming\Microsoft\Windows\SendTo
Links on taskbar:
To make this show, right-click on task bar and choose "toolbars". Enable "links"
Fault tolerance:
IDE / ATA
SCSI
FAT / NTFS
Add new scsi drive: plug in, at startup: verify that the new disk is recognized. W2000: in computer management / disk management : should see the new disk. Right click to format.
Installing new driver to replace a previous driver: information about the old
driver prevents the new driver from being installed. This information is kept
in C:\WINNT\inf
. Move the file and start again.
Drivers *.sys may be in system32\drivers.
Windows Management Instrumentation Command-line (wmic)
wmic
at command linewmic /?
or /? on the command linediskdrive get status
: show disk status (not very verbose!)exit
Sytem Restore: all program > accessories > system tgools > system restore
Backup and restore registry: see Registry below
Recovery console: see operating system below
When cleaning viruses, the System Resore should be disabled.
To turn off:
To turn on, go to the same place and remove the check in the "Turn off System Restore" or "Turn off System Restore on all drives" check box.
regedit /
See service or driver startup options:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet00n\Services\<name of driver or
service><name of suspected service>
<-- try setting to disabled if
the driver or service is creating a problem
Boot 0x0 (only drivers)
System 0x1 (only drivers)
Automatic 0X2
Manual 0x3
Disabled 0x4
Which control set?:
HKEY_LOCAL_MACHINE\System\select\current
= n --> controlSet00n
HKEY_LOCAL_MACHINE\System\select\default
HKEY_LOCAL_MACHINE\System\select\lastKnownGood
Change the maximum registry size (RSL setting): Control Panel > System > Advanced tab. > Performance Options, > Change (Virtual Memory section). Then reboot. Note that the only time that I had this error, the system registry file had increased from 3MB to 146MB. So, I restored an old copy instead.
The registry is backed up with the ntbackup utility when the appropriate box is checked. The copies go into windows\repair\RegBack.
Restore the 5 registry files (default, sam, security, software and system):
Performance:
Audit failure of logon/logoff and audit success and failure of security policy changes.
For system information: start > programs > accessories > system information.
For performance: configuration panel > system properties > tab "advanced" > button "settings" in performance
Press F8 during startup ("Starting Windows" at bottom of screen):
Also:
msconfig startup tab: programs that are loaded on startup
Totals:
Physical memory: divided into memory
available for running programs and
system cache for virtual memory.
The total corresponds to the RAM size (see system properties).
Commit charge: shows the total of physical and virtual memory
Kernel
Recovery Console needs Setup CD or pre-install with "...\i386\winnt32.exe /cmdsons".
listsvc
enable <service> [StartType]
SERVICE_BOOT_START
(if required for operating system), SERVICE_SYSTEM_START
(normal operating start), SERVICE_AUTO_START
(auto start) or
SERVICE_DEMAND_START
(manual start).disable <service>
copy
delete
dir
dir /b
: just file names, no header or other informationdir file.name /s
: searches in the directory tree, lists the entry, and the directory it is in.
more
type
Start > programs > administrative tools > computer management > Device Manager
scsi
: SCSI disks for which the controller's SCSI BIOS is disabled;
use "disk
" parameter (tip: 4 letters).
multi
: IDE disks, and SCSI disks when SCSI BIOS is enabled; use
"rdisk
" parameter (tip: 5 letters).
Note that partition values start at 1, but other values start at 0.
Edit the boot.ini with the bootcfg command.
Examples of boot.ini
[boot loader] |
Here: first disk, first partition. Option to start in VGA mode.
[boot loader] |
First disk, first partition. Option to start with Recovery Console.
Open files (XP):
Openfiles /Query
Openfiles /Disconnect
Openfiles /Local
Note that simple file sharing is allowed in ... (surprise) ... the folder file options:
In 'Tools' > 'Internet Options' > 'Security' (tab) > 'Trusted Sites' >
'Custom Level' (button):
In 'Downloads', set 'Automatic prompting for file downloads' to 'Enable'.
In activeX controls and plugins,
set the 'Initialize and script Active X controls not marked as safe' option to 'Prompt'.
For windows: certmgr.msc
at command line
Firfox: menu options > advanced > certificates. Thunderbird: similar.
Verify hash files:
certutil -hashfile a_file_name sha256
type a_file_name.sha256
Main settings:
Copy vm:
Preparation for installation
Recommended software:
Some steps for installation
Network monitor: start - programs - administrative tools - network
ping -t addr
: ping continuously until ctrl-T
ping -a addr
: resolve address to host name
ping -w 5000 addr
: timeout to wait in milliseconds, here 5000
ping -n 1 addr
: send only 1 echo request
ping -t -a -w 10000 10.103.100.21
: example
Performance:
Ethernet
Network troubleshooting
Network Protocols
IP Address Structure
Address | 197 |
. |
203 |
. |
176 |
. |
213 |
|
Network ID
|
Host ID
|
|||||||
Address | 11000101 |
. |
1100101 |
1 |
. |
10110000 |
. |
11010101 |
Network ID | 11000101 |
. |
1100101 |
|
. |
|
. |
|
Host ID | |
. |
|
1 |
. |
10110000 |
. |
11010101 |
Subnet Mask | 11111111 |
. |
1111111 |
0 |
. |
00000000 |
. |
00000000 |
Here, the subnet mask is 255.254.0.0 or /15.
Notation /n indicates the number of bits in the subnet mask.
Generally, the subnet masks are 255.0.0.0 or /8, 255.255.0.0/16 or 255.255.255.0/24:
Class | Subnet Mask | Addresses |
Number of
Networks |
Hosts per
Network |
A
|
255. 0 . 0 . 0 or /8 |
0bbb bbbb.n.n.n or 1-126.n.n.n |
126
|
16'777'214
|
B
|
255.255. 0 . 0 or /16 |
10bb bbbb.n.n.n or 128-191.n.n.n |
16'384
|
65'534
|
C
|
255.255.255. 0 or /24 |
11bb bbbb.n.n.n or 192-223.n.n.n |
2'097'152
|
254
|
Non-routable IP addresses:
FQDN = Fully Qualified Domain Names = <computer name>.<domain name>.<domain
extension>
where the names can begin with numbers, no longer than 255 characters, a-z,
A-Z, 0-9 and hyphens (no spaces), case insensitive.
Windows name resolution (order of resolution in W2000 systems and newer):
ipconfig /displaydns
, flush with
ipconfig /flushdns
)%systemroot%\system32\drivers\etc\hosts
)nbtstat -c
Automatic addressing in Windows2000: if a DHCP server cannot be contacted, the computer gives itself an address in range 169.254.0.1 to 169.254.255.254 /16 (i.e. class B, subnet mask 255.255.0.0). So, if the ipconfig command shows an address 169.254.x.x on W2000, then the DHCP server cannot be contacted.
Basic Training for Office 2007
Microsoft Training Site for all Office 2007 applications
Help for Word 2007
Microsoft Site with Tips, Tricks and Tutorials
Top Tips for Word 2007
Microsoft Site
DEMO on Outlook 2007
Microsoft Training Site
Discontinued Features and Changes in Outlook 2007
Getting Up to Speed with:
Outlook 2007
Word 2007
Excel 2007
PowerPoint 2007
Field for date:
{SAVEDATE \@ "yyyy-MM-dd HH:mm" \* MERGEFORMAT}
{DATE \@ "MMM/d/yyyy"}
{page}
{ DOCPROPERTY "Project" \* MERGEFORMAT }
Lost all menus in Word:
in command line: winword -a
-a recuperates the default options
Switch between viewing results and formulas: CTRL+` (grave accent), or Tools menu > Formula Auditing > Formula Auditing Mode.
Paste from a word table to excel: remove all end-of-paragraph marks in the table, select the whole table, paste special in word (just text).
Bullet lists
Print in black&white: first reduce the background graphics in the master slide; then set to black and white (menu view > black and white)
Master slide: menu view > master
Manage the indents: make the ruler visible with menu > view > ruler
A spreadsheet used to have a maximum of 65536 rows and 256 columns (up to column IV)
Now the maximum is 1,048,576 rows and 16,384 columns.
Formats in cells:
#\ ?/?
: fractionsCommand line:
start excel file.name
start excel /r file.name
: open read-only
start excel /s file.name
: safe mode
Also start winword
or start notepad
or start powerpnt
List of functions available
sum(..)
trim(a string)
mid(str,start,len)
find("chars",string[,start pos])
Position of the characters in the string substitute("ch\ars","\", "\\") --> ch\\ars
Substitute one set of characters for another =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(E10,"'","''"),CHAR(10),""),CHAR(13),"")
=LEFT(A2,FIND(".",A2,1)-1)
Extract the first part of a string with cccc.cccc=MID(A2,LEN(B2)+2,300)
Extract the second partcode("text")
--> ascii value value("text")
--> number char(number)
--> character a1=a2
: equality, returns true or falseisblank(...)
: ture if blankand(), or(), not()
: logical operatorssumproduct(a1:14,b1:14)
equivalent to a1*b1 + a2*b2 + ... a14*b14
sumproduct(a1:14,b1:14) / sum(b1:b14)
: weighted averagesumif(a:a,b4,b:b)
Sum of all cells in column b where the cell in column a is equal to b4.
Column A has the criteria; column B has the data, even though it is optional!vlookup
(column of values to look up, column(s) of reference
data, column number in reference data (1st col = 1), false) VLOOKUP($E:$E, Sheet2!$B:$K, 3, TRUE)
Take data in column
E, "join" to column B in sheet 2 and return the data from the 3rd column.
True allows data to be returned if there is not a perfect match. It is best
to sort all data first.=IF(B7="X", B$6, IF(C7="X", C$6, "Not Defined") )
=IF(B2="","",IF(F2="","",B2=F2))
: compare only if cells contain something ="print '" & A7 & "'; update the_table set a_col = '" & F7 & "' where
b_col = '" & A7 & "';"
match(value, lookup array, -1 0 or 1)
: returns the position of the value
in the array. Wild cards * and ? can be used with text.NOT(ISERROR(...)))
: handle the "#N/A" gracefullyreplace("string", start, end, "new text")
: replace the characters from start to end with 'new text'substitute("string", "look for", "replace with" [, num])
: replace the character(s)
'look for' with 'replace with'. If num is not null, then replace a specific instance only, otherwise all=INDIRECT("'" & B$1 & "'!A:D")
: indirect reference to another sheetTips
Code for macro to clean up excel sheet:
' Removing tabs and carriage returns from worksheet cells
Sub CleanUp()
Dim TheCell As Range
On Error Resume Next
For Each TheCell In ActiveSheet.UsedRange
With TheCell
If .HasFormula = False Then
.Value = Application.WorksheetFunction.Clean(.Value)
End If
End With
Next TheCell
End Sub
To transform columns into rows or vice-versa, copy and then paste special with the "transpose" option.
ctrl+Page up/down: go to next/previous tab
In a comma or tab separated file with data with leading zeros or spaces,
precede the value with equals sign (=) and a double quote. Add a double quote after
the value: ="000075"
.
This trick only works in Excel. Other programs cannot handle this.
See also notes on Informatica functions.
Also surround with quotes: if using the csv
format and opening the csv file directly, two options, otherwise a third option:
1) selectively surround the fields with commas and end-of-line characters with double quotes
2) or surround all fields with double quotes and double-up the double quotes in: =""000075""
3) If opening the file with the import wizard, surround with single quotes, not double quotes.
[Alt] + [Ctrl] + [- on Num pad] |
Em dash |
[Ctrl] + [- on Num pad] |
En dash |
[Ctrl] + [ _ ] ([Ctrl] + [Shift] + [- _]) |
Non-breaking hyphen |
[Ctrl] + [-] |
Optional hyphen |
Other characters: see chars.html
Windows shortcut keys: see Section on basics
For end of line characters, see chars.html
Bullet lists
hard space: ^space
Express:
C:\Program Files\Outlook Express\msimn.exe
Storage of digital signatures: documents and settings\ username\ application data\ microsoft\ signatures. Three files: .txt, .rtf, .htm. (outlook full)
Create personal folders: menu tools > services > tab services > add button
(for exchange servier) > personal folders
To create new outlook personal folder that can be put on any disk: menu file
> new > personal folder (*.pst).
F7
shows the recently types commands. Same as doskey /history
Some pre-defined variables:
%date% %time% %userprofile%IF [NOT] ERRORLEVEL number command
IF [NOT] string1==string2 command
IF [NOT] EXIST filename command
if "%OS%"=="Windows_NT" setlocal
if "%2"=="" goto usage
. . .
goto exit
:usage
echo Usage: the_command userid passwd
echo %%1%%
set h10=%time:~0,1%
if "%h10%"==" " set datetimef=%date:~-4%_%date:~0,3%_%date:~4,2%_0%time:~1,1%%time:~3,2%%time:~6,2%
if "%h10%"=="0" set datetimef=%date:~-4%_%date:~0,3%_%date:~4,2%_%time:~0,2%%time:~3,2%%time:~6,2%
if "%h10%"=="1" set datetimef=%date:~-4%_%date:~0,3%_%date:~4,2%_%time:~0,2%%time:~3,2%%time:~6,2%
This assumes that the date format is "dd mon yyyy".
Substring, from 5th position (0 is 1st), 3 characters: %a_string:~4,3%
Last 4: %a_string:~-4%
Stop services:
NET STOP "service name in full"
Map disk (need to work on this):
NET USE ...
This removes all files, then all sub-directories:
del /S /Q C:\dir\subdir
rmdir /S /Q C:\dir\subdir
pause
exit
cd a_directory
cd /D X:\...\a_directory
set var
set var=a_value
set /A expression
set /P variable[=a_prompt_string]
pause a_message
rem a remark
call an_executable
start application
echo a text .. ^< ^>
date /T
time /T
type a_file
xcopy /D:01-31-2008 /S /Y source_dir target
findstr /l /i the_string_to_search *.sql
findstr /?
/l -->
search literally, as opposed to regular expression (/r)/b -->
at beginning of line/e -->
at end of line/s -->
sub-directories too/i -->
case INsensitiveglu
glu
glu
date /T > copy_log.log |
%CD%
--> current directory
%DATE%
--> current date using same format as DATE command.
%TIME%
--> current time using same format as TIME command.
%ERRORLEVEL%
--> ERRORLEVEL value
For others, see help set
.
Path and variables
right click on start button >
menu settings > system > about > related settings / system info > advanced tab > button at bottom "env var"
See where the executable is installed: where executable
FOR %variable IN (set) DO command [command-parameters] %variable Specifies a replaceable parameter. (set) Specifies a set of one or more files. Wildcards may be used. command Specifies the command to carry out for each file. command-parameters Specifies parameters or switches for the specified command. To use the FOR command in a batch program, specify %%variable instead of %variable Variable names are case sensitive, so %i is different from %I.
Example:
rem Parameter 1: the target SID |
For end of line characters, see chars.html
Another example:
@ECHO OFF |
dir env:
See environment variables
$env:VAR_NAME = ‘a value’
Set a variable
$env:VAR_NAME += ‘;a value’
Add to a variable (notice "+" sign)
Troubleshooting windows system
sfc /scannow
verify the integrity of the Windows system filessigverif
verify that all system files are digitally signeddriverquery
look at driver files (Win7)tasklist
tasks that are running (Win7)taskkill
/pid tasknumber or /im taskname. Use /f if necessary to kill forcefullyTroubleshooting Network
ipconfig /all
nslookup a_host_name
see the IP address and which server resolved itSee [1].
Identifying the problem | What happened? What error messages? (read the error message before clicking the "OK") |
Documenting the history of the problem |
What are the recent changes on the computer?
|
Analyzing the current environment |
|
Documenting processes involved in the problem | Picture... What are the dependencies between processes... |
Eliminating what works |
|
Correcting the problem | Process-Oriented Corrective Action, i.e. correct the underlying cause of the problem. |
Testing the corrective action | Test before announcing that all is corrected. |
Following up with wider maintenance | Apply the lessons learned. |
Troubleshooting
Symptom | Tools for diagnostic | Problem | Resolution |
---|---|---|---|
Slow when logging on | ipconfig /all | DNS and WINS pointing to the wrong machine | Network properties > tab Protocols > TCPIP protocol > button properties |
Slow | spybot or other | Undesirable programs | Also try the immunize so that the problems don't come back |
Sites re-directed in the browser | Extra lines added to hosts file | Remove the lines | |
IE browser has odd behavior | Extra add-ins running | Remove: tools > options > settings > view objects | |
Wireless device was disabled | ? | Add hardware, choose add existing hardware (the driver showed with a red X) | |
Issues in connection to web site | Add the domain to the list of trusted sites in tools > internet options > security tab > trusted sites > sites. Remove the check in "require server verification." | ||
Cannot connect to network | Network connection disabled | In control panel > network connections, enable the connection. | |
Computer is "thinking" too much | Diagnostics option at boot | Memory failing | |
C disk is full | Old files | Empty files in:C:\WINNT\SoftwareDistribution\Download (net stop/start wuauserv) |
Get current version of operating system: type winver
in command
line.
Current version of of directx: dxdiag
For browsing Internet, use a non-administrator user
Some links for troubleshooting windows:
Bibliography
[1] Chris Wolf: Troubleshooting Microsoft Technologies, The Ultimate Administrator's Repair Manual, Addison Wesley, 2003.
Curious behavior: write in word document: =rand(100,1)
=rand(p,s)
create random text with p paragraphs and s sentences
=lorem(p,s)
create random text
=rand.old(p,s)
creates quick ... sentences