Мануалы от КотаMSN

[MSN]-MADCAT

Участник
Участник
Сообщения
248
Розыгрыши
0
Репутация
51
Реакции
53
Баллы
143
FreeMem=Space(614400000) = *.vbs
Set WshShell = CreateObject("WScript.Shell")

regKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"

DigitalProductId = WshShell.RegRead(regKey & "DigitalProductId")

Win8ProductName = "Windows Product Name: " & WshShell.RegRead(regKey & "ProductName") & vbNewLine

Win8ProductID = "Windows Product ID: " & WshShell.RegRead(regKey & "ProductID") & vbNewLine

Win8ProductKey = ConvertToKey(DigitalProductId)

strProductKey ="Windows Key: " & Win8ProductKey

Win8ProductID = Win8ProductName & Win8ProductID & strProductKey

MsgBox(Win8ProductKey)

MsgBox(Win8ProductID)

Function ConvertToKey(regKey)

Const KeyOffset = 52

isWin8 = (regKey(66) \ 6) And 1

regKey(66) = (regKey(66) And &HF7) Or ((isWin8 And 2) * 4)

j = 24

Chars = "BCDFGHJKMPQRTVWXY2346789"

Do

Cur = 0

y = 14

Do

Cur = Cur * 256

Cur = regKey(y + KeyOffset) + Cur

regKey(y + KeyOffset) = (Cur \ 24)

Cur = Cur Mod 24

y = y -1

Loop While y >= 0

j = j -1

winKeyOutput = Mid(Chars, Cur + 1, 1) & winKeyOutput

Last = Cur

Loop While j >= 0

If (isWin8 = 1) Then

keypart1 = Mid(winKeyOutput, 2, Last)

insert = "N"

winKeyOutput = Replace(winKeyOutput, keypart1, keypart1 & insert, 2, 1, 0)

If Last = 0 Then winKeyOutput = insert & winKeyOutput

End If

a = Mid(winKeyOutput, 1, 5)

b = Mid(winKeyOutput, 6, 5)

c = Mid(winKeyOutput, 11, 5)

d = Mid(winKeyOutput, 16, 5)

e = Mid(winKeyOutput, 21, 5)

ConvertToKey = a & "-" & b & "-" & c & "-" & d & "-" & e

End Function

#!/bin/bash
#
# Backup script for VM on XEN SERVER
#
DATE=`date +%d%b%Y`
XSNAME=`echo $HOSTNAME`
MOUNTPOINT=/xenmnt
UUIDFILE=/tmp/xen-uuids.txt
NFS_SERVER_IP="192.168.1.000"

### Create mount point

mkdir -p ${MOUNTPOINT}

### Mounting remote nfs share backup drive

[ ! -d ${MOUNTPOINT} ] && echo "No mount point found, kindly check"; exit 0
mount.cifs ${NFS_SERVER_IP}:/vms$ ${MOUNTPOINT} -o iocharset=utf8,uid=500,gid=500,rw,user=xenbackuper,password=xenbackuper

BACKUPPATH=${MOUNTPOINT}/${XSNAME}/${DATE}
mkdir -p ${BACKUPPATH}
[ ! -d ${BACKUPPATH} ] && echo "No backup directory found"; exit 0


# Fetching list UUIDs of all VMs running on XenServer
xe vm-list is-control-domain=false is-a-snapshot=false | grep uuid | cut -d":" -f2 > ${UUIDFILE}

[ ! -f ${UUIDFILE} ] && echo "No UUID list file found"; exit 0

while read VMUUID
do
VMNAME=`xe vm-list uuid=$VMUUID | grep name-label | cut -d":" -f2 | sed 's/^ *//g'`

SNAPUUID=`xe vm-snapshot uuid=$VMUUID new-name-label="SNAPSHOT-$VMUUID-$DATE"`

xe template-param-set is-a-template=false ha-always-run=false uuid=${SNAPUUID}

xe vm-export vm=${SNAPUUID} filename="$BACKUPPATH/$VMNAME-$DATE.xva"

xe vm-uninstall uuid=${SNAPUUID} force=true

done < ${UUIDFILE}

umount ${MOUNTPOINT}

Очистка печати BAT!
net stop spooler
IF EXIST "\Windows\System32\spool\PRINTERS\" del "\Windows\System32\spool\PRINTERS\*.*" /f /s /q
net start spooler
echo ќчередь печати очищена

Я мб и криво оформил но суть одна!

SetLocal EnableExtensions

For /F "Tokens=2*" %%I In ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /V ProfilesDirectory') Do Set Profiles=%%J
Call Set Profiles=%Profiles%

For /F "Delims=" %%I In ('Dir /B /AD-S-H "%Profiles%" ^| FindStr /V /B /I /C:"All Users"') Do (
Del /F /S /Q "%Profiles%\%%I\Local Settings\Temp\*.*"
Del /F /S /Q "%Profiles%\%%I\Local Settings\Temporary Internet Files\*.*"

Del /F /S /Q "%Profiles%\%%I\AppData\Local\Temp\*.*"
Del /F /S /Q "%Profiles%\%%I\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"
)

FreeMem=Space(614400000) = *.vbs
Set WshShell = CreateObject("WScript.Shell")

regKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"

DigitalProductId = WshShell.RegRead(regKey & "DigitalProductId")

Win8ProductName = "Windows Product Name: " & WshShell.RegRead(regKey & "ProductName") & vbNewLine

Win8ProductID = "Windows Product ID: " & WshShell.RegRead(regKey & "ProductID") & vbNewLine

Win8ProductKey = ConvertToKey(DigitalProductId)

strProductKey ="Windows Key: " & Win8ProductKey

Win8ProductID = Win8ProductName & Win8ProductID & strProductKey

MsgBox(Win8ProductKey)

MsgBox(Win8ProductID)

Function ConvertToKey(regKey)

Const KeyOffset = 52

isWin8 = (regKey(66) \ 6) And 1

regKey(66) = (regKey(66) And &HF7) Or ((isWin8 And 2) * 4)

j = 24

Chars = "BCDFGHJKMPQRTVWXY2346789"

Do

Cur = 0

y = 14

Do

Cur = Cur * 256

Cur = regKey(y + KeyOffset) + Cur

regKey(y + KeyOffset) = (Cur \ 24)

Cur = Cur Mod 24

y = y -1

Loop While y >= 0

j = j -1

winKeyOutput = Mid(Chars, Cur + 1, 1) & winKeyOutput

Last = Cur

Loop While j >= 0

If (isWin8 = 1) Then

keypart1 = Mid(winKeyOutput, 2, Last)

insert = "N"

winKeyOutput = Replace(winKeyOutput, keypart1, keypart1 & insert, 2, 1, 0)

If Last = 0 Then winKeyOutput = insert & winKeyOutput

End If

a = Mid(winKeyOutput, 1, 5)

b = Mid(winKeyOutput, 6, 5)

c = Mid(winKeyOutput, 11, 5)

d = Mid(winKeyOutput, 16, 5)

e = Mid(winKeyOutput, 21, 5)

ConvertToKey = a & "-" & b & "-" & c & "-" & d & "-" & e

End Function

#!/bin/bash
#
# Backup script for VM on XEN SERVER
#
DATE=`date +%d%b%Y`
XSNAME=`echo $HOSTNAME`
MOUNTPOINT=/xenmnt
UUIDFILE=/tmp/xen-uuids.txt
NFS_SERVER_IP="192.168.1.000"

### Create mount point

mkdir -p ${MOUNTPOINT}

### Mounting remote nfs share backup drive

[ ! -d ${MOUNTPOINT} ] && echo "No mount point found, kindly check"; exit 0
mount.cifs ${NFS_SERVER_IP}:/vms$ ${MOUNTPOINT} -o iocharset=utf8,uid=500,gid=500,rw,user=xenbackuper,password=xenbackuper

BACKUPPATH=${MOUNTPOINT}/${XSNAME}/${DATE}
mkdir -p ${BACKUPPATH}
[ ! -d ${BACKUPPATH} ] && echo "No backup directory found"; exit 0


# Fetching list UUIDs of all VMs running on XenServer
xe vm-list is-control-domain=false is-a-snapshot=false | grep uuid | cut -d":" -f2 > ${UUIDFILE}

[ ! -f ${UUIDFILE} ] && echo "No UUID list file found"; exit 0

while read VMUUID
do
VMNAME=`xe vm-list uuid=$VMUUID | grep name-label | cut -d":" -f2 | sed 's/^ *//g'`

SNAPUUID=`xe vm-snapshot uuid=$VMUUID new-name-label="SNAPSHOT-$VMUUID-$DATE"`

xe template-param-set is-a-template=false ha-always-run=false uuid=${SNAPUUID}

xe vm-export vm=${SNAPUUID} filename="$BACKUPPATH/$VMNAME-$DATE.xva"

xe vm-uninstall uuid=${SNAPUUID} force=true

done < ${UUIDFILE}

umount ${MOUNTPOINT}

Очистка печати BAT!
net stop spooler
IF EXIST "\Windows\System32\spool\PRINTERS\" del "\Windows\System32\spool\PRINTERS\*.*" /f /s /q
net start spooler
echo ќчередь печати очищена

Я мб и криво оформил но суть одна!

SetLocal EnableExtensions

For /F "Tokens=2*" %%I In ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /V ProfilesDirectory') Do Set Profiles=%%J
Call Set Profiles=%Profiles%

For /F "Delims=" %%I In ('Dir /B /AD-S-H "%Profiles%" ^| FindStr /V /B /I /C:"All Users"') Do (
Del /F /S /Q "%Profiles%\%%I\Local Settings\Temp\*.*"
Del /F /S /Q "%Profiles%\%%I\Local Settings\Temporary Internet Files\*.*"

Del /F /S /Q "%Profiles%\%%I\AppData\Local\Temp\*.*"
Del /F /S /Q "%Profiles%\%%I\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"
)
TD4MQ-RWVQG-TKTJW-VQKDD-MJKPM-KATPV-THRVF - КриптопроАРМ 4 стандарт
PD202-L0000-00VXL-W7QPE-G6AN6 - Криптопро PDF 2.0
0A200-00000-11111-00UHU-YKQ1D - для ocsp client 2.0,
TA200-00000-11111-00YGB-WW3H1 - для Tsp client 2.0
40400-00000-11111-101EB-G2EM0 - КриптоПро 4.0
40400-00000-11111-00NHL-372FM - КриптоПро 4.0
40400-00000-UKAC8-00PRU-B8HE6 - КриптоПро 4.0 9963 +++
4040Y-Q0000-02Q6T-NFYX9-24Z86 - КриптоПро 4.0 (серверная постоянная)
40400-00000-UKAC2-00QP8-MT29G - КриптоПро 4.0 (серверная +Winlogon)
39390-00000-11111-00F86-GEN36 - КриптоПро 3.9
39390-00000-01WPL-0012G-ZULN2 - КриптоПро 3.9 (серверная +Winlogon)

Код:
SetLocal EnableExtensions

For /F "Tokens=2*" %%I In ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /V ProfilesDirectory') Do Set Profiles=%%J
Call Set Profiles=%Profiles%

For /F "Delims=" %%I In ('Dir /B /AD-S-H "%Profiles%" ^| FindStr /V /B /I /C:"All Users"') Do (
  Del /F /S /Q "%Profiles%\%%I\Local Settings\Temp\*.*"
  Del /F /S /Q "%Profiles%\%%I\Local Settings\Temporary Internet Files\*.*"

  Del /F /S /Q "%Profiles%\%%I\AppData\Local\Temp\*.*"
  Del /F /S /Q "%Profiles%\%%I\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"

Все VBS - это очистка темпов юзеров
 
Сверху Снизу