Opening Control Panel / Display Properties: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
Line 17: Line 17:
</highlight-nsis>
</highlight-nsis>


Others parameters for RunDll32.exe:
  Open Control Panel:                RunDll32.exe shell32.dll,Control_RunDLL
  Add or Remove Programs:            RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,0
  Add or Remove Windows Components:  RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,2
  Windows FireWall:                  RunDll32.exe shell32.dll,Control_RunDLL firewall.cpl
 
  Add a Printer:                    RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL AddPrinter
  Connect To Printer:                RunDll32.exe WINSPOOL.DRV,ConnectToPrinterDlg
  Open Printers Folder:              RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL PrintersFolder
  Print a Test Page:                RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL PrintTestPage
 
  ShareManager:                      RunDll32.exe NTLANUI.DLL,ShareManage
 
  Properties of the system:          RunDll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,#
 
  Lock WorkStation:                  RunDll32.exe user32.dll,LockWorkStation
  Close Session:                    RunDll32.exe SHELL32.DLL,SHExitWindowsEx 0
  Suspend and hibernate:            RunDll32.exe powrprof.dll,SetSuspendState
[[Category:Code Examples]]
[[Category:Code Examples]]

Revision as of 05:34, 2 August 2006

Author: seu (talk, contrib)


How To Use

To open control panel (to let the user change some setting, for example) you can use RUNDLL32.EXE, like this:

Rundll32.exe shell32.dll,Control_RunDLL <contrl>,<applet>, <page>

For Display Properties / Screen Saver the command would be:

Rundll32.exe shell32.dll,Control_RunDLL Desk.cpl,@0, 1

So you can add some section at the end of your script for doing it with the Exec command:

Section "Display Properties"
        Exec 'Rundll32.exe shell32.dll,Control_RunDLL Desk.cpl,@0, 1'
SectionEnd

Others parameters for RunDll32.exe:

 Open Control Panel:                RunDll32.exe shell32.dll,Control_RunDLL
 Add or Remove Programs:            RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,0
 Add or Remove Windows Components:  RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,2
 Windows FireWall:                  RunDll32.exe shell32.dll,Control_RunDLL firewall.cpl
 
 Add a Printer:                     RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL AddPrinter
 Connect To Printer:                RunDll32.exe WINSPOOL.DRV,ConnectToPrinterDlg
 Open Printers Folder:              RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL PrintersFolder
 Print a Test Page:                 RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL PrintTestPage
 
 ShareManager:                      RunDll32.exe NTLANUI.DLL,ShareManage
 
 Properties of the system:          RunDll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,#
 
 Lock WorkStation:                  RunDll32.exe user32.dll,LockWorkStation
 Close Session:                     RunDll32.exe SHELL32.DLL,SHExitWindowsEx 0
 Suspend and hibernate:             RunDll32.exe powrprof.dll,SetSuspendState