Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

This means: look for those lines starting (^) with a, then 0 or more characters and finally and e at the end of the line ($).

grep -riL done *

Search for all of the file names that do not contain the text "done" (recursive, case insensitive)

grep -ri "p 2425" * 

Useful for searching Radmind command files for transcripts (p) from a specific year (2425) (recursive, case insensitive)

vi

https://www.cs.colostate.edu/helpdocs/vi.html

...

from a terminal window

xattr -c nameofthe.dmg

Finding a developer's code sign number

codesign -dv /path/to/kext

Windows

Using Environment Variables

Sooooo.  I forgot to talk to you about something, Sam.  I'm going to paste it here so we can chat asynchronously before I go on vacation.With the Windows K1000 packages that need updating, we're going to rewrite the install.bat files (and any other related files) to use environment variables instead of c:\This needs to happen in the body of the files and the command at the top that gets you to the native command prompt.  I've updated the wiki page of code snippits:https://wiki.carleton.edu/display/itskb/Reb%27s+Handy+Bits+of+Code#Reb'sHandyBitsofCode-GettingtotheNativecmdpromptAnd here is one of the office install.bat files as an example:

No Format
========================================================
@echo off
if not exist "%windir%\sysnative\cmd.exe" goto :gonenative
echo Relaunching with x64 cmd.exe...
"%windir%\sysnative\cmd.exe" /C "%~dpnx0"
goto :EOF

:gonenative
REM ---paste the rest of your batch code below this line---

========================================================
If exist "%ProgramFiles%\KACE\ds\office rd /s /q "%ProgramFiles%\KACE\ds\office\" 
echo Copying Office Repo
xcopy office\Office-2023.05.11\office "%ProgramFiles%\KACE\ds\office" /e /c /h /i /r /y /z
echo Installing Office
"%ProgramFiles%\KACE\ds\office\setup.exe" /configure "%ProgramFiles%\KACE\ds\office\2021uon-2022.05.11.xml"
cscript.exe "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" /sethst:kms3.ads.carleton.edu
cscript.exe "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" /act
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run /v TeamsMachineInstaller /f

You can see the Windows environment variables by typing SET in the command prompt.Some of them resolve to the same place, so for c:\ProgramData, let's use %ProgramData%, not %ALLUSERSPROFILE%. For c:\Program Files, let's use %ProgramFiles% and not %ProgramW6432%. Let's use %SystemDrive% and not %HOMEDRIVE% and %windir% not %Systemroot%. It's probably most important that we do this for commonly used applications.

Imaging

Change Image Host Name

...

Initialize-Disk -Number 0 -PartitionStyle GPT

 

Getting System Info

Detecting Windows Version

CMD:

 ver | find "6.3" >nul && goto WIN8

...

Get-WindowsEdition -Verbose -Online

Detecting Hardware Model

  if /i "%WMICModel:~0,7%"=="20074DU" set TP=y

...