Scripting help

Excel

=CONCATENATE("ping ";A19;" -n 1")

Command Prompt:

SpyBot 1.4
spybotsd.exe /taskbarhide /autoupdate /autocheck /autoimmunize /autoclose

Hide Server
net config server /hidden:yes|no

Sophos 5.x Uninstall
msiexec.exe /X{09C6BF52-6DBA-4A97-9939-B6C24E4738BF} /q RebootYesNo="No" Reboot="Suppress"
msiexec.exe /X{C12953C2-4F15-4A6C-91BC-511B96AE2775} /q
msiexec.exe /X{FF11005D-CBC8-45D5-A288-25C7BB304121} /q
start psexec -i \\PC1 (ime .cmdja lokalno)c:\un-3.cmd

Disk ClenUp wizard
REM cleanmgr /sageset:1 "Nastaviš reg key, kaj pucati"
REM cleanmgr /sagerun:1 /d c: "Zaženeš po reg keyu ki si ga nastavil"

Ad-Aware 6.0
REM    The parameters have the following function:
REM    +A: perform all automatically (scan, remove and clean)"
REM    +S: Silent mode, minimize aaw during the operation"
REM    +0: don't use in-depth scan"
REM    +1: use in-depth scan"
REM    if neither +0 nor +1 is used, the last user setting will be used."
REM    NOTE: to send parameters to an already running instance, add the +SD parameter"
start C:\Progra~1\lavasoft\ad-awa~1\Ad-Aware.exe "C:\" +S +A +1

Aida32 Report
aida32 /R c:\windows\$HOSTNAME /CSV /SILENT

Add local user
NET USER Bostjan Password. /ADD /fullname:"Boštjan Kavčič" /passwordchg:no

Add domain user
dsadd user CN=uporabnik,CN=Users,DC=elmo,DC=local -samid logon_name -fn Ime -ln Priimek -upn mailbox@domain.local -pwd Password.

List of computer accounts
REM ipis NB imen računalnikov iz AD ("BOSTJANKA"):
dsquery computer -scope subtree -limit 500 -o rdn
REM izpis FQDN imen računalnikov iz AD ("CN=BOSTJANKA,OU=Domain Computers,DC=atlantis,DC=local"):
dsquery computer -scope subtree -limit 500

Set Network
netsh interface ip set address name="Internet" source=static addr=194.249.55.227 mask=255.255.255.128
netsh interface ip set address name="Internet" gateway=194.249.55.227 gwmetric=1
netsh interface ip set dns name="Internet" source=static addr=193.2.1.66 register=primary
netsh interface ip add dns name="Internet" addr=193.2.1.72 index=2

Setup MSDE
C:\sql2ksp3\MSDE\setup.exe INSTANCENAME=MSDE3 SAPWD="Password."

Move Trend Micro OfficeScan Client
REM program, -s server, -p srv. port, -m HTTP=1 FILE=0, -c cli. port
\\slugec\ofcscan\Admin\Utility\IpXfer\IpXfer.exe -s slugec.home.local -p 8080 -m 1 -c 33389

REM cmd start to tekst file
@echo off
dir *.* > Log.txt

Logon script
net use s: \\streznik\skupno
net use h: \\streznik\uporabniki\%username%

Linux add user
useradd username -d /home/userhome -p Password.
usermod username -U


Windows Registry Editor Version 5.00

IE more than 2 concurent connections to site
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"MaxConnectionsPerServer"=dword:00000009
"MaxConnectionsPerl_OServer"=dword:00000009

Remote Enable RDP
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\fDenyTSConnection 1 to 0

MSN Proxy
[HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger]
"ProxyState"=hex:00,00,00,00

[HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger]
"ProxyState"=hex:ff,ff,ff,ff

IE Proxy
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000000
"AutoConfigURL"="http://10.114.70.15/proxy.pac"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"AutoConfigURL"=""
"ProxyEnable"=dword:00000001
"ProxyServer"="proxy:8080"
"ProxyOverride"="10.10.*;*.atlantis.local;<local>"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"AutoConfigURL"=""
"ProxyEnable"=dword:00000000



VBScript 1.
Install network printer
'  VBScript.' Guy Thomas February 2004.
'  http://computerperformance.co.uk

'  Purpose of script to create a local printer
' ******************************

Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\elmodc\hp4000n"

VBScript 2.
Hotel first start script

' -----------------------------------------------
'
' Module Name: autologin.vbs
'
' Copyright (c) 2004, TSE Trade
' Copyright (c) 2004, Atlantis
'
' By Robert Kuster & Bostjan Kavic
'   May 2004 - Aug 2004
'
' Abstract:
'   a) sets the autologon registry values
'   b) sets autostart for gmService.exe
'   c) activates windows
'   d) reboots the computer
'
' -----------------------------------------------


'-------------scripte start

On Error Resume Next

'----------------- generate logon username (i.e.: COMPUTERYXZ -> RoomXYZ )
'
Dim szHost
Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
szHost = WshNetwork.ComputerName

Dim szUser
szUser = Replace (szHost, "COMPUTER", "Room")
 

'----------------- set autologon via registry
'
Dim WSHShell, RegLocate
Set WSHShell = WScript.CreateObject("WScript.Shell")

RegLocate = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon"
WSHShell.RegWrite RegLocate,"1","REG_SZ"

RegLocate = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName"
WSHShell.RegWrite RegLocate,szUser,"REG_SZ"

RegLocate = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultPassword"
WSHShell.RegWrite RegLocate,szUser,"REG_SZ"

RegLocate = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName"
WSHShell.RegWrite RegLocate,"USB","REG_SZ"

RegLocate = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DisableCAD"
WSHShell.RegWrite RegLocate,"1","REG_DWORD"


'----------------- set autostart for gmService.exe
'
' Note: "" == Escaped Double Quote
'
WSHShell.Run("sc config ""Grand Media Hotel"" start= auto")


'----------------- activate windows
'
' Note: Recomended time ~30s
'   -> set shutdown -t appropriately
'
for each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation")
      if Obj.ActivationRequired <> 0 then
            Obj.ActivateOnline()
      end if
next


'----------------- reboot computer
'
WSHShell.Run("shutdown -r -t 60")
WScript.Quit ' Tells the script to stop and exit.


'-----------------scripte end

VBScript 3.
Izvajanje nekega ukaza z parametrom iz datoteke .txt
'
' runcommand executes the command on all computers listed in ListOfComputers
'
Dim objFSO, objLOG, objTextFile, objLogFile, Line, ListOfComputers, FailedComputers, WSHShell, CountFailed, NewLine

' --- file with list of computers
ListOfComputers = "computers.txt"
LogFile = "logfile.txt"
CommandToExecute = "C:\RADIX\PROTECT6\RDXSET.EXE ddfvNRMNv2Bl3xZIQxogIgRIFYeiZRJhBqzKPbfMh+l2TfiGqtOPDXbcE/2wNKub"
NewLine = Chr(10)
FailedComputers = "Remote command failed on computers: " & NewLine & NewLine
CountFailed = 0

Set WSHShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(ListOfComputers, 1)
Set objLOG = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objLOG.CreateTextFile(LogFile, TRUE)

' --- repeat until we reach end of the list
While Not objTextFile.AtEndOfStream
  ComputerName = objTextFile.ReadLine

' open maximized and wait - 3, true
' open minimized and wait - 2,
Linux cmd find: # find / -name '*exe'
 grep -r "searched text" *