Sometimes we need to do just alittle more than RUNDLL32 is capable of, like installing a TCP/IP printer port.
In that case, consider buying yourself a copy of the Windows 2000 Server/Windows Server 2003 Resource Kit and use PRNADMIN.DLL and the accompanying sample scripts written in VBScript.
My own AddIPPrn.bat below uses these VBScripts to install a printer, its driver and a TCP/IP printer port on a remote computer
@ECHO OFF
:: Check Windows version
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
SETLOCAL
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: ::
:: Modify the following lines; no quotes for PrnShort and PortIP! ::
:: ::
:: The values for PrnType and TargetOS can be found in the INF file ::
:: that comes with the (extracted) printer driver. ::
:: ::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
SET PrnName="Accounting 2nd Floor"
SET PrnShort=Accounting2
SET PrnType="Kyocera Mita FS-3820N"
SET DrvPath="\\server\share\Drivers\Kyocera\FS-3820N\W2K"
SET InfPath="\\server\share\Drivers\Kyocera\FS-3820N\W2K\oemsetup.inf"
SET PortIP=112.113.114.115
SET TargetOS="Windows 2000"
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: ::
:: End of adjustments ::
:: ::
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: Check command line arguments
IF "%~1"=="" GOTO Syntax
SET PC=%~1
ECHO."%PC%" | FINDSTR.EXE /R /C:"[?/]" >NUL && GOTO Syntax
PING.EXE %PC% 2>NUL | FIND.EXE "TTL=" >NUL || (
ECHO Computer %PC% is unavailable
ECHO.
GOTO Syntax
)
:: Check if the required VBScripts are available in the current directory
SET Error=0
FOR %%A IN (prncfg prnmgr drvmgr portmgr) DO IF NOT EXIST %%A.vbs SET Error=1
IF "%Error%"=="1" GOTO Syntax
:: Check if the printer was installed already
CSCRIPT.EXE //NoLogo prnmgr.vbs -l -c \\%PC% | FIND.EXE /I "%PrnShort%" >NUL && (
ECHO A printer named %PrnShort% already exists on %PC%
ECHO.
GOTO Syntax
)
:: Check if the printer port was installed already
CSCRIPT.EXE //NoLogo portmgr.vbs -l -c \\%PC% | FINDSTR.EXE /E /I "IP_%PortIP%" >NUL && (
ECHO TCP/IP printer port %PortIP% already exists on %PC%
ECHO.
GOTO Syntax
)
:: Prompt the user, and allow him/her to abort the installation
ECHO You are about to add a local printer %PrnShort% on computer %PC%
ECHO.
PAUSE
:: Install the driver
CSCRIPT.EXE //NoLogo drvmgr.vbs -a -c \\%PC% -p %DrvPath% -i %InfPath% -v %TargetOS% -m %PrnType% -t Intel
:: Install the local IP print port, type raw, SNMP disabled
CSCRIPT.EXE //NoLogo portmgr.vbs -a -c \\%PC% -p IP_%PortIP% -h %PortIP% -t raw -n 9100 -md
:: Install the local printer with the driver and port we just installed
CSCRIPT.EXE //NoLogo prnmgr.vbs -a -c \\%PC% -b %PrnName% -m %PrnType% -r IP_%PortIP%
:: Configure the local printer as not shared and not published in Active Directory
CSCRIPT.EXE //NoLogo prncfg.vbs -s -b \\%PC%\%PrnShort% -published -shared
:: Display or log the configuration of the new printer
IF /I "%~2"=="/L" (SET Log="%PrnShort%_%PC%.log") ELSE (SET Log=CON)
(
CSCRIPT.EXE //NoLogo drvmgr.vbs -l -c \\%PC%
CSCRIPT.EXE //NoLogo portmgr.vbs -l -c \\%PC%
CSCRIPT.EXE //NoLogo prnmgr.vbs -l -c \\%PC%
CSCRIPT.EXE //NoLogo prncfg.vbs -g -b \\%PC%\%PrnShort%
) > %Log% 2>&1
:: Done
GOTO End
:Syntax
ECHO.
ECHO AddIPPrn.bat, Version 1.01 for Windows 2000 with Server Resource Kit
ECHO Install a (hard coded) local IP printer %PrnShort% on a remote computer
ECHO.
ECHO Usage: ADDIPPRN.BAT computername [ /L ]
ECHO.
ECHO Where: "computername" is the computer on which the printer should be installed
ECHO "/L" logs the results in {printername}_{computername}.log
ECHO (default is display on screen)
ECHO.
ECHO Notes: [1] You need to modify the first couple of lines from this batch file
ECHO to install your own printer, port and driver. You may then want
ECHO to save the modified batch file as {printername}.bat.
ECHO [2] This batch file requires drvmgr.vbs, portmgr.vbs, prnmgr.vbs and
ECHO prncfg.vbs from the Windows 2000/2003 Server Resource Kit; these
ECHO scripts must all be located in the current directory.
ECHO [3] These VBScripts require PRNADMIN.DLL from the Resource Kit to be
ECHO installed on the computer that runs the scripts.
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com
:End
IF "%OS%"=="Windows_NT" ENDLOCAL
Often the printer configurations of existing computers need to be cloned to other computers, or restored after reinstalling Windows.
In those cases, a backup/export and restore/import with Microsoft’s PrintMig 3.1 may be the best (and easiest) solution.
Though earlier versions of PrintMig were GUI only, version 3.1 can also be run without user interaction from the command line or in a batch file:
Microsoft (R) Windows (TM) Printer Migrator 3.1
Copyright (C) 1997-2002 Microsoft Corp. All rights reserved
usage: PRINTMIG [options] [server]
[-?] Display this message
[-b] Backup - followed by CAB file name
[-r] Restore - followed by CAB file name
[-l] Attempt to convert LPR Ports to SPM
[-i] Suppress warning popups. Info still written to log file.
If server is not specified then the local machine is implied.
Example command line to restore an existing config to a server:
printmig -r d:\print\ps1.cab \\prt-srvr1
Example command line to backup a server to the specified file:
printmig -b "\\filesrv\store\print server 2.cab" \\prt-srvr2
in command prompt type: rundll32 printui.dll,PrintUIEntry /?
i.e C:\Documents and Settings\Administrator>rundll32 printui.dll,PrintUIEntry /?
this will show all the usable parameters, as below. PrintUI is the command to search. can be used on batch file and in login script.
Usage: rundll32 printui.dll,PrintUIEntry [options] [@commandfile]
/a[file] binary file name
/b[name] base printer name
/c[name] unc machine name if the action is on a remote machine
/dl delete local printer
/dn delete network printer connection
/dd delete printer driver
/e display printing preferences
/f[file] either inf file or output file
/ga add per machine printer connections
/ge enum per machine printer connections
/gd delete per machine printer connections
/h[arch] driver architecture one of the following, Alpha | Intel | IA64 | x64
/ia install printer driver using inf file
/id install printer driver using add printer driver wizard
/if install printer using inf file
/ii install printer using add printer wizard with an inf file
/il install printer using add printer wizard
/in add network printer connection
/j[provider] print provider name
/k print test page to specified printer, cannot be combined with command when installing a printer
/l[path] printer driver source path
/m[model] printer driver model name
/n[name] printer name
/o display printer queue view
/p display printer properties
/q quiet mode, do not display error messages
/r[port] port name
/s display server properties
/Ss Store printer settings into a file
/Sr Restore printer settings from a file
Store or restore printer settings option flags that must be placed at the end of command:
2 PRINTER_INFO_2
7 PRINTER_INFO_7
c Color Profile
d PrinterData
s Security descriptor
g Global DevMode
m Minimal settings
u User DevMode
r Resolve name conflicts
f Force name
p Resolve port
/u use the existing printer driver if it’s already installed
/t[#] zero based index page to start on
/v[version] driver version one of the following, Windows 95, 98 and Me | Windows NT 4.0 | Windows NT 4.0 or 2000 | Windows 2000 or XP | Windows XP
/w prompt the user for a driver if specified driver is not found in the inf
/y set printer as the default
/Xg get printer settings
/Xs set printer settings
/z do not auto share this printer
/Y do not auto generate a printer name
/K changes the meaning of /v and /h to accept 0,1,2,3, respectively for Windows x64 and Windows IA64 | Windows NT x86 | Windows NT Alpha_AXP | Windows 4.0
/Z share this printer, can only be used with the /if option
/? help this message
@[file] command line argument file
/Mw[message] show a warning message before committing the command
/Mq[message] show a confirmation message before committing the command
/W[flags] specifies flags and switches for the wizards (for APW & APDW)
r make the wizards to be restart-able from the last page
/G[flags] specifies global flags and switches
w suppress setup driver warnings UI (super quiet mode)
Examples:
Run server properties:
rundll32 printui.dll,PrintUIEntry /s /t1 /n\\machine
Run printer properties:
rundll32 printui.dll,PrintUIEntry /p /n\\machine\printer
Run add printer wizard localy:
rundll32 printui.dll,PrintUIEntry /il
Run add printer wizard on \\machine:
rundll32 printui.dll,PrintUIEntry /il /c\\machine
Run queue view:
rundll32 printui.dll,PrintUIEntry /o /n\\machine\printer
Run inf install:
rundll32 printui.dll,PrintUIEntry /if /b “Test Printer” /f %windir%\inf\ntprint.inf /r “lpt1:” /m “AGFA-AccuSet v52.3″
Run add printer wizard using inf:
rundll32 printui.dll,PrintUIEntry /ii /f %windir%\inf\ntprint.inf
Add per machine printer connection:
rundll32 printui.dll,PrintUIEntry /ga /c\\machine /n\\machine\printer /j”LanMan Print Services”
Delete per machine printer connection:
rundll32 printui.dll,PrintUIEntry /gd /c\\machine /n\\machine\printer
Enumerate per machine printer connections:
rundll32 printui.dll,PrintUIEntry /ge /c\\machine
Add printer driver using inf:
rundll32 printui.dll,PrintUIEntry /ia /c\\machine /m “AGFA-AccuSet v52.3” /h “Intel” /v “Windows 2000 or XP” /f %windir%\inf\ntprint.inf
Add printer driver using inf:
rundll32 printui.dll,PrintUIEntry /ia /K /c\\machine /m “AGFA-AccuSet v52.3” /h “Windows NT x86” /v 3
Remove printer driver:
rundll32 printui.dll,PrintUIEntry /dd /c\\machine /m “AGFA-AccuSet v52.3” /h “Intel” /v “Windows 2000 or XP”
Remove printer driver:
rundll32 printui.dll,PrintUIEntry /dd /K /c\\machine /m “AGFA-AccuSet v52.3” /h “Windows NT x86” /v 3
Set printer as default:
rundll32 printui.dll,PrintUIEntry /y /n “printer”
Set printer comment:
rundll32 printui.dll,PrintUIEntry /Xs /n “printer” comment “My Cool Printer”
Get printer settings:
rundll32 printui.dll,PrintUIEntry /Xg /n “printer”
Get printer settings saving results in a file:
rundll32 printui.dll,PrintUIEntry /f “results.txt” /Xg /n “printer”
Set printer settings command usage:
rundll32 printui.dll,PrintUIEntry /Xs /n “printer” ?
Store all printer settings into a file:
rundll32 printui.dll,PrintUIEntry /Ss /n “printer” /a “file.dat”
Restore all printer settings from a file:
rundll32 printui.dll,PrintUIEntry /Sr /n “printer” /a “file.dat”
Store printer information on level 2 into a file :
rundll32 printui.dll,PrintUIEntry /Ss /n “printer” /a “file.dat” 2
Restore from a file printer security descriptor:
rundll32 printui.dll,PrintUIEntry /Sr /n “printer” /a “file.dat” s
Restore from a file printer global devmode and printer data:
rundll32 printui.dll,PrintUIEntry /Sr /n “printer” /a “file.dat” g d
Restore from a file minimum settings and resolve port name:
rundll32 printui.dll,PrintUIEntry /Sr /n “printer” /a “file.dat” m p
********************
Baseline Switch 2948 – How to reset password on switch 2948
Problem: How to reset password on switch 2948
The resetting of the password requires the installation of a console cable to the console port.
Be sure the terminal emulator program is set to VT-100 management using compatible, 38400 baud rate, no parity, 8 data bits and Console connection one stop bit.
Use the included cable, or be sure that the pin-out complies with a standard null-modem cable
Once the cable is connected, reboot the switch. Type a Ctrl/C until you enter the failsafe mode. This will be denoted with the prompt: “CFE>”
At the prompt execute the following commands:
CFE> passwrd
CFE> reset -sysreset
Try starting while holding the Command-Option-Shift-Delete keys all at the same time and see if it will let you startup/install.
Do you have any external drives you could install Tiger on first?
If the above doesn’t work, try this:
1. Start Mac and hold Option-Command-O-F keys
2. When the grey screen gets loaded type reset-nvram then press Return key
3. At next prompt type reset-all and the Mac will restart
For those you who are looking for the comprehensive details steps of how to P2V a linux box with VMware Converter.
Pre-requisites: Have the Linux installation Boot CD1 handy. You should purchase VMware Converter Enterprise license.
1. Download VMware Converter Enterprise latest version and burn it to the CD. I used version 3.0.2 update 1.
2. Boot up with the above VMware Converter CD on the physical Linux box.
3. Let the WinPE load up and watch for the Network adaptor settings screen. Make necessary changes such as IP addressing.
4. Finally you should see the VMware Converter screen where you can import the machine.
5. Click on Import machine button and follow the steps.
6. Important Make sure you select all disks and no resizing during the import process.
7. If all the information is entered correctly, it should start importing to ESX/VC.
8. It will create a VM on the selected ESX server.
9. In my case it failed at 97% where the error occurs at customization steps (which I did not configure for) but after successful copy of the local disks.
10. Go to the ESX server where the imported VM resides. Edit the settings.
11. In the VM’s settings, check any irregular settings which might appears. In my case, I had to change the OS type of VM from other 32bit to REHL 4.
12. When the VM is powered up for the first time as soon as P2V has finished, kernel panic will occur and it is just as expected. Steps to fix the kernel panic on the Linux VM
13. Boot up with the bootable Linux installation CD 1. If it doesn’t boot from the CD, you may have to change the VM’s setting to go to the BIOS setting on the next boot so that you can change the boot sequence.
14. At the boot: prompt type Linux rescue and hit enter.
15. It will search for the Linux partition. In my case, it could not find the hard disks. So, I had to go back to VM’s setting to change the BusLogic SCSI controller to LsiLogic.
16. After changing to LsiLogic controller, Linux installation image was able to find the Linux partitions on the VM.
17. The system will give you opportunity to mount the root file system. At the linux prompt, type: chroot /mnt/sysimage and hit enter.
18. It will get you back to the prompt. Now at the prompt type: kudzu and hit enter.
19. It will ask you to remove old hardware and detect and install new hardware. Follow the instructions.
20. After exiting from Kudzu, at the prompt type: ls /lib/modules and take note of the version/image. For instance, your active linux version is 2.6.9-5.ELsmp. Take note of it.
21. After that you will need to make new RAM disk as follows.
22. Type /sbin/mkinitrd -v -f /boot/initrd-2.6.9-5.ELsmp.img 2.6.9-5.ELsmp
23. Reboot.
24. After the reboot, it should successfully boot up without any kernel panic.
25. If you still see the kernel panic, then go back to step 20 and find the correct module and repeat the steps 22 & 23.
26. After you have booted the system successfully, determine if it is working as expected.
27. Install VMware Tools.
The steps from 13 to 24 should take about 20-30 minutes. This procedure should be the same for most Linux distributions. Hope it will help on your P2V of Linux boxes.
NTFS with read/write support using the ntfs-3g (easy & safe method
Set up your sources :
To get the latest ntfs-3g, you will need first to add a repository to your source.list. Open a terminal and type:
Code:
gksu gedit /etc/apt/sources.list
At the end of the file, just add one of the following mirror:
Warning : This repo don’t contain amd64 packages.
For DAPPER : Feisty users don’t have to deal with additionnal repository, all is already in ubuntu repo.
deb http://flomertens.free.fr/ubuntu/ dapper main main-all
deb http://ntfs-3g.sitesweetsite.info/ubuntu/ dapper main main-all
deb http://flomertens.keo.in/ubuntu/ dapper main main-all
2. Installation :
Packages of my repository are authenticated with a gpg key. To use it, you should execute the following command :