Showing posts with label window. Show all posts
Showing posts with label window. Show all posts

Tuesday, March 16, 2010

Window 7 Ultimate Aero preview does not work

Windows 7 user can preview the actual window when they hover their mouse over the application bar (at the bottom of the window). This is known as the Aero effect.

Problem:
The user can only see a rectangular box (no preview). Is my installation faulty? No.

Cause:
The Aero effect is not turn on by default for Windows 7 Ultimate edition. It depends on a window service called Desktop Window Manager Session Manager. The service is set to manual for default installation.

Resolution:
Set the "Desktop Window Manager Session Manager" start mode to "Automatic".

Step-by-step:
  1. Type services.exe into the Run textbox and press enter. This will open the window service listing.
  2. Locate Desktop Window Manager Session Manager service and right click on "Properties"
  3. Set the start mode to Automatic.
  4. For instance effect, start the service.
  5. Voila.

How to open network connections window

To open "Network Connections" window via command prompt

Type npca.cpl in Start->Run textbox (works with WinXP and Windows 7).

To open "Add Remove program" window via command prompt

Type appwiz.cpl in Start->Run textbox (works with WinXP and Windows 7).

Thursday, May 28, 2009

Wednesday, May 27, 2009

How to find out window environment values another way

Normally, you would show the System Properties window.



Method 1 - Navigate via MyComputer
Right click on the My computer -> Properties -> Goto Advanced tab -> Click on Environment Variables. Then see Temp = %USERPROFILE%\Local Settings\Temp


Method 2 - msinfo32
Type msinfo32 in the run command.


Method 3 - Dos command
Open command prompt by typing in cmd. type the following:
echo %path%

Method 4 - Powershell tool
Open powershell and type
4.1) $env:path // show envrionmen vairable ("path")
4.2) [Environment]::GetEnvironmentVariable("path")


How to show all environment vairables in powershell
Get-Item $env:* or env:*

Friday, May 22, 2009

Save and restore Powershell history session

Use this command to store powershell session history into xml file
Get-History | Export-Clixml "c:\scripts\my_history.xml"

Use this to restore Powershell history from file.
Import-Clixml "C:\PowershellSession.xml" |Add-History


How to show the list of command history?
h or Get-History

How can i find out the alias for Get-History?
Get-Alias -Definition Get-History



What to do if I have duplicate command in the history?
We wish to have a unique entry per command. Edit the window properties and check 'Discard Old Duplicates'.

Set command window to powershell background

The colour for powershell window background RGB(1,36,86). You can set your command window to the same colour.

Shortcut key to show Window system properties

Try [WindowKey] + break.

Alternatively, type sysdm.cpl in run.

Sunday, May 17, 2009

How to hide vista users at Welcome screen

  1. Type regedit to run Registry Editor
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList.
  3. Create folder for SpecialAccounts or UserList in the registry order above if it's not found. Right click on the Winlogon folder in registry editor and select new folder to create the folder.
  4. Create a new DWORD(32 bits for 32bits vista os) key with value 0 (as default) under UserList registry folder. Name the key as the vista login you would like to hide.
  5. For example, if your vista login name is Belacan. Then the new key should be belacan (case in-sensitive).
  6. The DWORD value 0 indicates hiding. You can set the value to 1 if you would like to show it in the future.

Disable Vista 'Need your permission to continue'

Whenever a user performs what window think it potentially risky operation, the following message is displayed to warn and asked for confirmation.



How to disable it?
  1. Open control panel, type user account in the search box.
  2. Click on 'Turn User Account Control (UAC) on or off.
  3. Uncheck the the tickbox and restart window.
  4. Voila. No more annoying pop-up.

Monday, May 11, 2009

Crash Dump Analysis

My window crashes recently and left me a 171Mb Memory.dmp file at c:\windows. I decided to find out more about what happened. Windbg download from here.

Open WinDbg and load the symbol server from the link below: srv*c:\symbols*http://msdl.microsoft.com/download/symbols

Open Crash Dump/Ctrtl+D and open c:\windows\memory.dmp.



To be continued .... (quite busy recently)

Wednesday, April 29, 2009

Window PowerShell 2 Quick Tips

Windows PowerShell

Windows PowerShell is a command-line shell and scripting environment that brings the power of the .NET Framework to command-line users and script writers. It introduces a number of powerful new concepts that enables you to extend the knowledge you have gained and the scripts you have created within the Windows Command Prompt and Windows Script Host environments.


Figure 1.0 PowerShell window.

Windows PowerShell V2 Community Technology Preview 3 (CTP3)


PowerShell Benefits
  • Extension to command line windows.
  • Performing common system administration tasks. E.g. managing the registry, services, processes, and event logs, and using Windows Management Instrumentation(WMI).
  • Simplified, command-based navigation of the operating system, which lets users navigate the registry and other data stores
  • Read WMI object values and invoke its method directly.
Useful Commands (Examples):
I hope the following list of examples could get you playing:

1. Get help on particular command: man . E.g. man get-service

2. See a list of command available: get-command

3. Clear the screen: clear-host

4. Show info for Http Web Server service: get-service -include {w3svc} | where-object {$_.status -like "*running*"} | format-list (As in Figure 1.0 command)

5. Get the system date: get-date

6. Get the service DisplayName only: get-service w3svc | format-list -property DisplayName

7. List service : get-service | where-object {$_.name -like "[v-z]*"} | Sort -descending "Status"

8. Show .net component methods:
[System.Math] | Get-Member -MemberType Methods

9. Get newest 5 system event log entry:
Get-EventLog -newest 5 -ComputerName confucius -logname System | Format-List Index, Message
10. List a service member. The following snippet filter the remote service on a machine fireserver name to httpd (Apache Web server)
"httpd"| Get-Service -computername fireserver | Get-Member
11. Start a service remotely
(Get-WmiObject -Computername Win32_Service -Filter "Name='
'").InvokeMethod("StopService",$null)

e.g.
(Get-WmiObject -Computername fireserver Win32_Service -Filter "DisplayName='Computer Browser'").InvokeMethod("StopService",$null)

12.
Copy files
Copy-Item c:\mydoc\text.doc c:\backup

13. Create file/folder
New-Item c:\scripts\Windows PowerShell -type directory

14. Check file exist
Test-Path c:\scripts\
text.doc

15. Write data into xml file
Get-Process | Export-Clixml c:\scripts\process-list.xml

16. Run a program. Use Invoke-Expression
to run a Powershell script.
Invoke-Item notepad.

17. How to see all previous commands and batch it up?
Get-History
or
h // alias for Get-History

Running it in batch
Invoke-History 34;Invoke-History 23

18. Filter command result by its property name
Get-Process -ProcessName svch* // list process with name starts with svch

Get-Process -ProcessName s?c* // list process with name starts with s followed by any character; followed by c and etc.

19. List environment variables
$env:computername
$env:classpath

More to come ....


Acronyms:

* cmdlet, wmi.

Monday, April 20, 2009

How to find out current logon username and domain (via dos command)

  1. Open command prompt window (by typing in cmd in Start-> Run textbox).
  2. Type echo %userdomain%\%username% and press enter.

Monday, March 30, 2009

How to show Computer Name screen (via command prompt)

Type sysadmin.cpl at the window run dialog.






Monday, December 01, 2008

How to add/remove program via Run command

Click Start->Run, type in appwiz.cpl.

Tuesday, July 15, 2008

Remote desktop to existing session

Type the following into windows run command

mstsc /console.

The remote desktop dialog appears and log in as normal.

Friday, May 23, 2008

Netmeeting to share desktop

There is an easier way to share the screen with another computer user. VNC is one of the choice but sometimes required port 5900 set up correctly through the firewall/router.

Why not try netmeeting?

1) How to set up
Type 'conf' (without the quotation mark) in the Start -> Run dialog. Go through the default configuration until the netmeeting application appears.

The remote user does the same. Type 'conf' in the run menu.

2) How to connect?

Click on netmeeting menu Help-> About window netmeeting
. This will show your ip address.

The remote user types the ip address (destination machine ip) in the and press the call button.

Thursday, August 02, 2007

How to run batch file using Visual Studio Window Installer?

I have recently came across a problem with my VS.net2003 Window Installer (.net fx 1.1). I have added some dll components to the setup package. I wish to run a batch file after the installation is completed. How do I achieve that?

I have tried the following:
1) Create a exe and run Process.start() and add it as custom actions. Result = failed.
2) Create vbs and add into Window installer custom actions. Result = failed because the installer run the script before the files is installed to the target folder.


Finally, I found the problem lies in the where you overwrite the System.Configuration.Install namespace events. We should use OnAfterInstall() rather than OnInstall() or OnCommit().

Solution:
1) Create the Window Installer project in Visual Studio2003 as normal.
2) Create a c# or vb.net DLL project. Add a new item 'Installer Class' under the project. This will create a class that we can override any default installation process.
3) Add in the following code to overwrite installation event. Remember, you have to overwrite OnAfterInstall().

protected override
void OnAfterInstall(IDictionary savedState)
{
     base.OnAfterInstall (savedState);
     // Add your custom code after this

     // Process.Start (@"c:\mybatch.bat");

}


4) Add the new DLL project to your solution.
5) Add the newly build DLL output to the custom action under 'Install' and 'Commit' folder.








6) Compile the setup project and voilĂ , your batch file is run as soon as the installation committed.










Notes:
- If you wish to pass your target directory to the Installer class.
Add the following targ= "[TARGETDIR\]" to the custom action 'CustomActionData' properties.

- How do I read the custom action parameter from the Installer class?
use the following code to read the passed in parameter.

this.Context.Parameters["targ"];

- If you want to see all the Installer Context parameters, use the following code:

Import the following namespace in your project and paste the following code.

System.Text and System.Collection.Specialized.

private void ShowContext(string where)
{
StringBuilder sb = new StringBuilder();
StringDictionary myStringDictionary = this.Context.Parameters;
sb.Append("From " + where + "\n");
if (this.Context.Parameters.Count > 0)
{
foreach (string myString in this.Context.Parameters.Keys)
{
sb.AppendFormat("String={0} Value= {1}\n", myString,
this.Context.Parameters[myString]);
}
}
MessageBox.Show(sb.ToString());
}