Windows: Comparison of Windows Commands and Linux Commands

So I went to this conference awhile back and sat through a presentation.  Not really interesting, but since I am new to the whole Linux world I thought I would pass this along.  Here is a PowerPoint presentation explaining the difference’s between Windows and Linux commands, at least common ones.  Enjoy!

Linux-Windows – Comparison of Commands

Advertisements

Scripting: Open Excel Sheets in Separate Windows

If you work in an environment similar to my previous position, then you would know how often you hear certain complaints after upgrading people to new applications or Operating Systems. Well one of those complaints came from individuals that we upgraded to Office 2010. They were use to the option of opening up Excel Spreadsheets in separate windows, but in Office 2010 you can’t do this by default you have to make a few tweaks. My fix was to create a little Batch script that would alter the Registry and allow this to be done. I hope you enjoy…..

Open Excel Sheets in Separate Windows

cd %~dp0
echo off
cls

ECHO ***** This batch script is not working. Please double-click on the REG
ECHO files themselves and answer Yes to pop-ups to manually set the new entries.
ECHO Click the [X] in the top-right corner to Exit.

pause

ECHO Close Excel if running... NO reboot is required by this script.
ECHO Pressing (Space) or another key will CHANGE Excel 2010 to open
ECHO files in separate windows. If you do NOT want this, click the close
ECHO [X] in the top-right Corner to close this window now.
ECHO Press [Space} to continue and answer YES to any pop up messages...

Pause

regedit /s "del_HK_classes_root-excelsheet8-shell-open.reg"
regedit /s "hk-classes_root-excelsheet8_shell_open-newwinhack.reg"
regedit /s "del_HK_classes_root-excelsheet12-shell-open.reg"
regedit /s "hk-classes_root-excelsheet12_shell_open-newwinhack.reg"

pause

cls

ECHO Excel 2010 will now open files in separate windows. If this IS what
ECHO you want, click the [X] in top-right corner to close this window now.
ECHO Pressing (space) or other keys will RESET Excel 2010 to its original
ECHO single-window mode.
ECHO Answer YES to any pop up messages...

Pause

regedit /s "del_HK_classes_root-excelsheet8-shell-open.reg"
regedit /s "hk-classes_root-excelsheet8_shell_open-original.reg"
regedit /s "del_HK_classes_root-excelsheet12-shell-open.reg"
regedit /s "hk-classes_root-excelsheet12_shell_open-original.reg"

exit

Registry Entries – Multi Window Excel Sheet

Scripting: Clean Java temporary install files from User Profiles – Win 7 & XP

So I had an issue awhile back that need to be rectified and the fix was to clean out temporary install files from the Sun/Java folder in User profiles. This had to be done on about 700 machines, so I created this little script that cleans out these files and pushed it out to via AD. I hope you enjoy…..

Win 7 – Clean Java Temp Files

CD C:\

CLS

ECHO


REM *** This DELETES temporary install files from the
REM *** SUN/JAVA folder in User Profiles.
REM *** Run this if you get a Pop-Up warning about your
REM *** User Profile being too large.
REM *** Click the corner [X] to exit without running.
REM *** Otherwise press the [Spacebar] to continue.

PAUSE

DEL "%USERPROFILE%\AppData\LocalLow\Sun\Java\*.*" /S /F /Q

RD "%USERPROFILE%\AppData\LocalLow\Sun\Java\" /S /Q

DEL "%USERPROFILE%\AppData\Local\Temp\*.*" /S /F /Q

RD "%USERPROFILE%\AppData\Local\Temp\" /S /Q

CLS

REM *** Folders are cleaned!

PAUSE

EXIT

Win XP – Clean Java Temp Files


CD C:\

CLS

ECHO

REM *** This script is for Windows XP only it will NOT work on Vista or 7
REM *** This DELETES temporary install files from the
REM *** SUN\JAVA and Local Settings\Temp folders in User Profiles.
REM *** Run this if you get a Pop-Up warning about your
REM *** User Profile being too large.
REM *** Click the corner [X] to exit without running.
REM *** Otherwise press the [Spacebar] to continue.

PAUSE

DEL "%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\Application Data\Sun\Java\*.*" /S /F /Q

RD "%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\Application Data\Sun\Java\" /S /Q

DEL "%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\Local Settings\Temp\*.*" /S /F /Q

RMDIR "%SYSTEMDRIVE%\Documents and Settings\%USERNAME%\Local Settings\Temp\" /S /Q

CLS

REM *** Folders are cleaned!

PAUSE

EXIT

Scripting: Mount Printer at Startup Script

So I had to come up with a batch script that would allow the user (in a lab) to select the printer that they wanted to use during that login session.  Pretty much this was placed in the startup folder on a few lab machines and every time someone would login (Deep Freeze Machines) it would ask them to select the printer that they wanted to print to.  It worked pretty well, I hope someone makes use of it.

REM /in = install network printer
REM /n = printer name
REM /y = sets as default
REM
REM Repeat Add printer commands as needed


@ECHO OFF
CLS
:BEGIN

ECHO.
ECHO 1 = Printer 1 2 = Printer 2
ECHO.
Set /p choice="Choose the number of the default printer you desire"
ECHO.
ECHO.
ECHO.
IF not '%choice%'=='' set choice=%choice:~0,1%
IF '%choice%'=='1' GOTO Printer1
IF '%choice%'=='2' GOTO Printer2

ECHO "%choice%" is not valid please try again
ECHO.
GOTO BEGIN

: Printer1
ECHO Installing [BPrinter1] on [PrinterServer]!
RunDll32.EXE printui.dll,PrintUIEntry /in /n \\PrinterServer\Printer1

ECHO Your default printer is [Printer1] on [PrinterServer]
REM Set Default Printer
RunDll32.EXE printui.dll,PrintUIEntry /y /n \\PrinterServer\Printer1
GOTO END

: Printer2
ECHO Installing [Printer2] on [PrinterServer]!
RunDll32.EXE printui.dll,PrintUIEntry /in /n \\PrinterServer\Printer2
ECHO Your default printer is [Printer2] on [PrinterServer]!
REM Set Default Printer
RunDll32.EXE printui.dll,PrintUIEntry /y /n \\PrinterServer\Printer2
GOTO END

:END