Script for Windows

Hi Experts,
We have Goldengate environment and replicating the data between on source to Many target environments , both source and target environments are Oracle only,  To monitor the process and exceptions we have used shell scripts on both the environments,
now we have new requirment for replicating the data between oracle to sql server , we have install goldengate on windows NT server for target environment , But in source we are using shell script for monitirong manger process and extract process , like if mgr or extract process is abended immediatly we will get the alert mail through mailx functionality, Now we need to use the same approach for windows sql serer as well , can any one please guide how to achive the monitoring requirment in windows environment as like unix/solaris, is there any option available in windows to writing the scritps like shell also sending the alert mails, Kindly suggest on this.
Thanks in Advance.
AT

I get the scheduler to run this batch file, dbcgen.bat
rem Set Correct Starting Directory
D:
cd \gw8\admin\utility\dbcopy\win32
cscript //NoLogo dbcgen.vbs > dbcrun.bat
dbcrun.bat
and the dbcgen.vbs does the rest
' Script to generate DBCRun.Bat file
' Result needs to be something like this
' D:\gw8\admin\UTILITY\DBCOPY\WIN32\dbcopy.exe /i 12-01-2010 /w n:\gw5po
c:\gw5back
Dim cDate
cDBCPath = "D:\GW8\Admin\Utility\DBCopy\Win32\DBCopy.exe"
cSrcPath = "N:\GW5PO"
cTgtPath = "C:\GW5Back"
dDate = Now() - 1
'WScript.Echo dDate
cDay = cStr(Day(dDate))
if Len(cDay) = 1 then
cDay = "0" & cDay
end if
'WScript.Echo cDay
cMonth = cStr(Month(dDate))
if Len(cMonth) = 1 then
cMonth = "0" & cMonth
end if
'WScript.Echo cMonth
cYear = cStr(Year(dDate))
'WScript.Echo cYear
cDate = cMonth & "-" & cDay & "-" & cYear
'WScript.Echo cDate
WSCript.Echo cDBCPath & " /i " & cDate & " /w " & cSrcPath & " " & cTgtPath
set cDate = Nothing
You can add/alter the various startup flags to suit yourself
Cheers Dave
Dave Parkes [NSCS]
Occasionally resident at http://support-forums.novell.com/

Similar Messages

  • Adobe CS3Clean Script for Windows

    I have downloaded and unzipped the file located at:
    http://www.adobe.com/support/contact/cs3clean.html
    English/Japanese
    Download the Adobe CS3Clean Script for Windows (ZIP, 978 KB)
    Each time I extract the files, the
    AdobeCS3CleanReadMe.pdf
    will not open because it is corrupt.
    There is an additional file named:
    âNâèü[âôâAâbâvâXâNâèâvâgé+é-éóé-.pdf
    which I have not attempted to open for obvious reasons....

    I don't know for sure, but a good guess is that it's the same
    readme in
    Japanese. I don't have Japanese characters installed so
    perhaps that's why
    the gobbletygook?
    However, the AdobeCS3CleanReadMe.pdf in the download I just
    got is fine.
    Try downloading again .. if that doesn't help .. and your
    Adobe Reader is
    updated .. drop me a line and I'll send you the PDF from my
    download.
    Nancy Gill
    Adobe Community Expert
    Author: Dreamweaver 8 e-book for the DMX Zone
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
    2003)
    Technical Editor: Dreamweaver CS3: The Missing Manual,
    DMX 2004: The Complete Reference, DMX 2004: A Beginner's
    Guide
    Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
    Web Development
    "sbuck415" <[email protected]> wrote in
    message
    news:fg5q7a$l0s$[email protected]..
    >I have downloaded and unzipped the file located at:
    >
    >
    http://www.adobe.com/support/contact/cs3clean.html
    >
    > English/Japanese
    > Download the Adobe CS3Clean Script for Windows (ZIP, 978
    KB)
    >
    > Each time I extract the files, the
    > AdobeCS3CleanReadMe.pdf
    > will not open because it is corrupt.
    >
    > There is an additional file named:
    > ?N???[???A?b?v?X?N???v?g?+?-???-.pdf
    > which I have not attempted to open for obvious
    reasons....
    >
    >
    >

  • Cold Backup Script for windows

    Hi,
    I have the following script for windows
    set pages 0 lines 500;
    set heading off echo off feedback off verify off pagesize 0;
    select 'copy ' || name || ' c:\BACKUP\COLD_BACKUP\ORADATA\' from v$datafile
    union all
    select 'copy ' || name || ' c:\BACKUP\COLD_BACKUP' from v$controlfile
    union all
    select 'copy ' || member ||' c:\BACKUP\COLD_BACKUP' from v$logfile
    union all
    select 'copy ' || name || ' c:\BACKUP\COLD_BACKUP' from v$tempfile;
    exit;
    In the above script I have given COLD_BACKUP directory for Backup....But what i want is Dynamically it should create the Directory with timestamp in COLD_BACKUP Directory and copy the files to that directory..
    for example
    script should create like this
    c:\BACKUP\COLD_BACKUP\ORCL_11112007
    Like that..it should create the ORCL_11112007 directory and copy the files....
    how can i acheive this...I know we can do it in UNIX..
    But in windows..how we can acheive this...please help me

    You can try to adapt the following SQL*Plus script to create a directory:
    set echo on
    alter session set nls_date_format = 'DDMMYYYY';
    var dd varchar2(10);
    begin
    :dd := trunc(sysdate);
    end;
    set echo off
    spool mkd.sql
    set heading off
    select 'host mkdir ' || :dd from dual;
    spool off
    set echo on
    @mkd.sqlOutput is:
    dev001> alter session set nls_date_format = 'DDMMYYYY';
    Session altered.
    dev001> var dd varchar2(10);
    dev001>
    dev001> begin
      2  :dd := trunc(sysdate);
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    dev001>
    dev001> set echo off
    host mkdir 08112007
    dev001> @mkd.sql
    dev001>
    dev001> host mkdir 08112007
    dev001>
    dev001>
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Cisco UT Lite script for windows 2012

    Hi;
    Will Cisco UT Lite script (for Prime LMS 4.2.4) will support with windows Active directory and domain controller on Windows 2012?
    If yes can you please share Link, I try to search but unfortunitly I counldn't found. All document refere till Windows 2003.
    Thanks for your cooperation.
    Best regards;
    Shoaib

    Hi Shoaib,
    there is no workaround. utlite script is supported on below platform only.
    •Windows 2008
    •Windows XP with SP2 or SP3
    •Windows Vista
    Thanks-
    Afroz
    [Do rate the useful post]

  • "samba-discovery". An automounter script for windows shares

    Hi.
    At the last lan party I found it quite annoying to mount samba shares by hand all the time (as I don't use a smb capable browser with fuse like dolphin or the like). So here's what I've come up with. Explenations on how it works are at the start of the script. You can also download it directly from here. Basically you run it and anything available on the lan will be tidily mounted to /mnt/samba-discovery/*.
    #!/bin/bash
    # Hi and welcome to this samba/windows share automounting script.
    # It will:
    # - Scan the network for windows/samba hosts.
    # - Mount all their available guest shares
    # - If rerun it will check if all shares are still accesible
    # - Unmount everything if you use the -u option
    # It will not:
    # - Work on password protected shares. No idea what will happen,
    # I guess mount.cifs will spit an error but the script will continue
    # Run it without options to mount/rescan, use -u to unmount everything.
    # Before running it please specify the options below.
    # Post questions on the Archlinux forum: http://bbs.archlinux.org/viewtopic.php?pid=596979#p596979
    # MOST IMPORTANTLY: If it eats all your files for breakfast, it's none
    # of my responsibility! It should be quite safe though because it's
    # always checking if a dir is empty before deleting it.
    ### Options
    # Specify the name of your network adapter (e.g. eth0):
    netiface='eth0'
    # Specify which range of IPs you're interested in (less is faster)
    lowend=1
    highend=20
    ### Code
    # Prepare samba-discovery folder
    if [[ ! -d /mnt/samba-discovery/ ]]; then
    mkdir /mnt/samba-discovery
    fi
    # Unmount all shares and clean up directories using -u
    umountcount=0
    uhostcount=0
    if [[ $1 == "-u" ]]; then
    shopt -s nullglob dotglob
    dirs=(/mnt/samba-discovery/*)
    (( ${#dirs[@]} )) || sharefolders=1
    shopt -u nullglob dotglob
    if [[ ! $sharefolders == 1 ]]; then
    for i in /mnt/samba-discovery/*/*; do
    umount "$i" 2>/dev/null
    cd "$i" 2>/dev/null
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || dirempty=1
    shopt -u nullglob dotglob
    if [[ ! $dirempty == 1 ]]; then
    echo ">>> warning: target directory not empty although share unmounted"
    echo ">>> aborting. please investigate directory:"
    echo " $i"
    exit 1
    else
    dirempty=0
    rm -R "$i"
    echo " share on $i unmounted, folder removed."
    ((umountcount++))
    fi
    done
    for i in /mnt/samba-discovery/*; do
    umount "$i" 2>/dev/null
    cd "$i" 2>/dev/null
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || dirempty=1
    shopt -u nullglob dotglob
    if [[ ! $dirempty == 1 ]]; then
    echo ">>> warning: target directory not empty although all shares unmounted"
    echo ">>> aborting. please investigate directory:"
    echo " $i"
    exit 1
    else
    dirempty=0
    rm -R "$i"
    echo " parent folder $i removed."
    ((uhostcount++))
    fi
    done
    echo "-> Removed $umountcount shares and $uhostcount parent folders"
    exit 0
    else
    echo "no parent folder found, nothing to unmount"
    exit 0
    fi
    fi
    # Normal run. Scan for shares which are no longer on the network...
    if [[ ! $1 == "" ]]; then
    echo "Invalid option. Aborted"
    exit 1
    fi
    shopt -s nullglob dotglob
    dirs=(/mnt/samba-discovery/*)
    (( ${#dirs[@]} )) || sharefolders=1
    shopt -u nullglob dotglob
    if [[ ! $sharefolders == 1 ]]; then
    echo ':: Cleaning up orphaned shares...'
    cleancount=0
    for i in /mnt/samba-discovery/*/*; do
    if [[ ! $(ls $i 2>/dev/null) ]]; then
    umount "$i" 2>/dev/null
    cd "$i" 2>/dev/null
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || dirempty=1
    shopt -u nullglob dotglob
    if [[ ! $dirempty == 1 ]]; then
    echo ">>> warning: target directory not empty although share unmounted"
    echo ">>> aborting. please investigate directory:"
    echo " $i"
    exit 1
    else
    dirempty=0
    rm -R "$i"
    echo " share on $i no longer accesible, removed."
    ((cleancount++))
    fi
    else
    if [[ ! $(cat /proc/mounts | grep "cifs" | awk '{print $2}' | grep $i) ]]; then
    cd "$i" 2>/dev/null
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || dirempty=1
    shopt -u nullglob dotglob
    if [[ ! $dirempty == 1 ]]; then
    echo ">>> warning: target directory not empty although nothing mounted there"
    echo ">>> aborting. please investigate directory:"
    echo " $i"
    exit 1
    else
    dirempty=0
    rm -R "$i"
    echo " nothing mounted on $i, removed."
    ((cleancount++))
    fi
    fi
    fi
    done
    echo "-> Cleaned out $cleancount shares"
    fi
    # ... and then scan for new hosts and mount shares
    echo ':: Scanning for new hosts and shares...'
    netaddr=$(ifconfig eth0 | grep "inet addr" | awk '{print $2}' | awk -F ":" '{print $2}' | awk -F "." '{print $1"."$2"."$3}')
    hostcount=0
    sharecount=0
    for ((ip=$lowend; ip<=$highend; ip++)); do
    printf " scanning $netaddr.$ip...\r"
    if (( $(nmap -PN -p139,445 "$netaddr.$ip" | grep -e "139/tcp open" -e "445/tcp open" | wc -l) == 2 )); then
    hostwinname="$( nmblookup -A $netaddr.$ip | grep "<00>" | grep -v "<GROUP>" | awk '{print $1}')"
    hostdirname="$(echo $hostwinname | tr [:upper:] [:lower:])"
    echo " found $hostwinname on $netaddr.$ip"
    IFS=$'\n' shares=($(smbclient -N -gL \\\\$netaddr.$ip\\ 2>&1 | grep -e "Disk|" | grep -v '\$' | awk -F "|" '{print $2}'))
    for share in ${shares[*]}; do
    sharedir="$(echo $share | sed s/\ /_/g | tr [:upper:] [:lower:])"
    if [[ "$(cat /proc/mounts | grep ",unc=\\\\\\\\$netaddr.$ip\\\\$share,")" ]]; then
    echo " share "$share" already mounted in /mnt/samba-discovery/$hostdirname/$sharedir"
    else
    if [[ ! -d "/mnt/samba-discovery/$hostdirname" ]]; then
    mkdir "/mnt/samba-discovery/$hostdirname"
    #echo "$hostwinname:$hostdirname:$netaddr.$ip" >> /mnt/samba-discovery/$hostdirname/ip.txt
    fi
    if [[ ! -d "/mnt/samba-discovery/$hostdirname/$sharedir" ]]; then
    mkdir "/mnt/samba-discovery/$hostdirname/$sharedir"
    else
    cd "/mnt/samba-discovery/$hostdirname/$sharedir"
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || dirempty=1
    shopt -u nullglob dotglob
    if [[ ! $dirempty == 1 ]]; then
    echo ">>> warning: mounting directory not empty although share not mounted!"
    echo ">>> aborting. please investigate directory:"
    echo " /mnt/samba-discovery/$hostdirname/$sharedir"
    exit 1
    fi
    dirempty=0
    fi
    mount "//192.168.1.$ip/$share" "/mnt/samba-discovery/$hostdirname/$sharedir" -o guest 2>/dev/null
    echo " mounted "$share" in /mnt/samba-discovery/$hostdirname/$sharedir"
    ((sharecount++))
    fi
    done
    ((hostcount++))
    fi
    done
    echo "-> Mounted $sharecount shares from $hostcount hosts."
    # Remove samba-discovery folder if it is empty
    if [[ -d /mnt/samba-discovery/ ]]; then
    cd "/mnt/samba-discovery/"
    shopt -s nullglob dotglob
    files=(*)
    (( ${#files[*]} )) || sambadirempty=1
    shopt -u nullglob dotglob
    if [[ sambadirempty == 1 ]]; then
    rm -R /mnt/samba-discovery/
    fi
    fi
    Here's some sample output of how it will look, including one orphaned share and a new one on a rerun of the script:
    [root@Mothership samba-discovery]# /home/medja/scripts/samba-discovery
    :: Cleaning up orphaned shares...
    share on /mnt/samba-discovery/blackrabbit/conflict_denied_ops no longer accesible, removed.
    -> Cleaned out 1 shares
    :: Scanning for new hosts and shares...
    found BLACKRABBIT on 192.168.1.2
    share CD-Images already mounted in /mnt/samba-discovery/blackrabbit/cd-images
    share CD-Images2 already mounted in /mnt/samba-discovery/blackrabbit/cd-images2
    share Filme already mounted in /mnt/samba-discovery/blackrabbit/filme
    share Filme2 already mounted in /mnt/samba-discovery/blackrabbit/filme2
    mounted Music Library in /mnt/samba-discovery/blackrabbit/music_library
    found MOTHERSHIP on 192.168.1.4
    share space already mounted in /mnt/samba-discovery/mothership/space
    found EEE on 192.168.1.5
    share SharedDocs already mounted in /mnt/samba-discovery/eee/shareddocs
    -> Mounted 1 shares from 3 hosts.
    Last edited by Shapeshifter (2009-08-07 18:51:05)

    thanks a lot, i wanted to write that script for a long time, but never got around. one thing though, you shouldn't mount stuff in a subfolder of /mnt because /mnt itself should be kept for such purposes (unix file hierarchy standards, afaik)
    but that should be easily fixed by myself
    cheers
    Phil
    Last edited by Heller_Barde (2009-08-07 21:42:46)

  • AD script For windows 2008

    Well to get a list of accounts with the never expire parameter you could do this
    dsquery user dc=yourdomain,dc=local -limit 500 | dsget user -samid -fn -ln -pwdneverexpires > output.txt
    That will list all accounts with a yes or no next to it.
    dsquery user dc=aerworldwide,dc=local -limit 500 -stalepwd 30  
    That will give you a list of accounts that have not changed their password in 30 days.  Adjust as you see fit.
    If you have more than 500 users, change the -limit statement accordingly.

    I have a windows 2008 AD. My DC is windows 2008 64bit ( NOT R2)
    I am implementing a new password policy. I need to generate a list of the last time each user's  password was reset and if the "never Expire" flag is set.  All the power shell scripts I see are for windows server 2008 R2 which use the getadUser power shell command.  
    This topic first appeared in the Spiceworks Community

  • Is there a script for Windows I can use to make iTunes read CD text?

    I've looked all over and all I cannot seem to find one that works for Windows, only Apple. Thanks!

    Yes, but you can always try customized skins from this site: http://itunes-skins.com/ .

  • Script for Window tiling in openbox

    I wanted to use a tiling window manager but didn't want to leave openbox. So I started using PyTyle and PyTyle2 but they both took up more RAM than I could afford to let them use in my lowly desktop. So I wrote a script to do my tiling for me using wmctrl and xwininfo. And here are the results:
    GRID mode:
    BOTTOM MASTER mode:
    TOP MASTER mode:
    LEFT MASTER mode (also the default) :
    RIGHT MASTER mode:
    MAX mode:
    HORIZONTAL SPLIT mode:
    VERTICAL SPLIT  mode :
    The entire thing is just one bash script that I named wmtiler.sh
    The script itself is rather poorly written as I don't have much experience in bash.
    #!/bin/bash
    # use wmctrl and xwininfo to tile windows
    #currently supports the "LEFT_MASTER" mode (default),
    # "RIGHT_MASTER" mode (-r) ,
    # "TOP_MASTER" mode (-t),
    #"BOTTOM_MASTER" mode (-b) ,
    #"GRID" mode (-g),
    #"MAX" mode (-m) ,
    # "VERTICAL_SPLIT" mode (-v) and
    #"HORIZONTAL_SPLIT" mode (-h)
    #NOTE: wmctrl sets the properties of the window itself i.e. the window manager's borders
    #and title bars are not taken into account while setting the coordinates. So for best results
    #set the window manager to display all windows undecorated
    #or manually set the title bar height here
    #List of things to do:
    # 1. Get the values of the TOP_MARGIN, BOTTOM_MARGIN, LEFT_MARGIN and RIGHT_MARGIN from the window manager
    # 2. Get the MASTER_WIDTH for the default LEFT_MASTER, RIGHT_MASTER layouts as a parameter , set a default if not provided
    # 3. Get the MASTER_HEIGHT for the default TOP_MASTER, BOTTOM_MASTER layouts as a parameter , set a default if not provided
    # 4. Get the NUMBER_OF_ROWS for the grid mode as a parameter, set a default if not provided
    # 5. Get the TITLE_BAR_HEIGHT from the window manager
    # 6. Restructure the code to use functions
    # 7. Provide mechanisms to increase/decrease the MASTER area
    # 8. Provide mechanisms to increase/decrease the number of windows in the MASTER area
    #List of bugs
    # 1. If called from a key combination, there may not be a :ACTIVE: window and in which case the results are not as desired.
    # 2. The title bar plays havoc with the height of windows
    #need to find a way to get these from the window manager
    TOP_MARGIN=18
    BOTTOM_MARGIN=18
    LEFT_MARGIN=0
    RIGHT_MARGIN=0
    TITLE_BAR_HEIGHT=17 #works best if all the windows are border less and this is set to zero
    #we are now using xwininfo to get these
    #HEIGHT=1080
    #WIDTH=1920
    #either set these in a file or calculate them from the screen properties
    MASTER_WIDTH=1344
    MASTER_HEIGHT=600
    #set the number of rows we want for the grid mode
    NUMBER_OF_ROWS=2
    #looks nice :)
    USELESS_GAPS=1
    #see what the user wants to do
    case $1 in
    "-g")
    MODE="GRID"
    "-m")
    MODE="MAX"
    "-v")
    MODE="VERTICAL_SPLIT"
    "-h")
    MODE="HORIZONTAL_SPLIT"
    "-t")
    MODE="TOP_MASTER"
    "-b")
    MODE="BOTTOM_MASTER"
    "-r")
    MODE="RIGHT_MASTER"
    MODE="LEFT_MASTER"
    esac
    #get the desktop parameters
    HEIGHT=`xwininfo -root | grep 'Height:' | awk '{print $2}'`
    WIDTH=`xwininfo -root | grep 'Width:' | awk '{print $2}'`
    #get the window parameters
    #get the current desktop
    CURR_DESK=` wmctrl -d | grep '* DG:'| awk '{print $1}'`
    #get the total number of windows.
    #NOTE: we are not directly using grep to get the windows from the current desktop as it may serve up some false positives
    TOTAL_WINDOWS=`wmctrl -lx | wc -l`
    #counter
    i=1
    #Assume that there are no windows in the current desktop
    WINDOWS_IN_DESK=0
    while [ $i -le $TOTAL_WINDOWS ] ; do
    CURR_LINE=`wmctrl -lx | head -n $i | tail -n 1`
    WIN_DESK=`echo $CURR_LINE | awk '{print $2}'`
    if [ $WIN_DESK -eq $CURR_DESK ] ; then
    #save the various window properties as supplied by wmctrl . Un comment rest if necessary. Include more if necessary
    WIN_XID[$WINDOWS_IN_DESK]=`echo $CURR_LINE | awk '{print $1}'`
    # WIN_XOFF[$WINDOWS_IN_DESK]=`echo $CURR_LINE | awk '{print $2}'`
    # WIN_YOFF[$WINDOWS_IN_DESK]=`echo $CURR_LINE | awk '{print $3}'`
    # WIN_WIDTH[$WINDOWS_IN_DESK]=`echo $CURR_LINE | awk '{print $4}'`
    # WIN_HEIGHT[$WINDOWS_IN_DESK]=`echo $CURR_LINE | awk '{print $5}'`
    #see if the window is "IsViewable" or "IsUnMapped" i.e minimized
    MAP_STATE=`xwininfo -id ${WIN_XID[$WINDOWS_IN_DESK]} | grep "Map State:" | awk '{print $3}'`
    #we don't want the minimized windows to be considered while allocating the space
    if [ "$MAP_STATE" == "IsViewable" ]; then
    WINDOWS_IN_DESK=$((WINDOWS_IN_DESK+1))
    fi
    fi
    i=$((i+1))
    done
    #get the xid of the active window.
    ACTIVE_WIN=`xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}'`
    #set the selected layout
    #NOTE: these would look better if they were individual functions :)
    case $MODE in
    "LEFT_MASTER")
    #define the properties of the master area
    X=$LEFT_MARGIN
    Y=$TOP_MARGIN
    #set the width to the default MASTER_WIDTH
    W=$MASTER_WIDTH
    H=$(( HEIGHT -TOP_MARGIN - BOTTOM_MARGIN -TITLE_BAR_HEIGHT -USELESS_GAPS))
    #set the active window to the "master "area
    wmctrl -r :ACTIVE: -e "0,$X,$Y,$W,$H"
    #now that the master window has been set all further windows would have to start from here
    X=$((MASTER_WIDTH+USELESS_GAPS))
    #get whatever width is left
    W=$((WIDTH - MASTER_WIDTH -USELESS_GAPS))
    #the height would be equally shared by the rest of the windows
    H=$((H/(WINDOWS_IN_DESK - 1) - TITLE_BAR_HEIGHT -USELESS_GAPS ))
    i=0
    while [ "$i" -le "$WINDOWS_IN_DESK" ] ; do
    #avoid setting the attributes of the active window again
    if [[ "${WIN_XID[$i]}" -ne "$ACTIVE_WIN" ]] ; then
    #set the attributes
    wmctrl -i -r ${WIN_XID[$i]} -e "0,$X,$Y,$W,$H"
    #set the Y co-ordinate for the next window.
    Y=$((Y+H+TITLE_BAR_HEIGHT+USELESS_GAPS))
    fi
    #preselect the next window
    i=$((i+1))
    done
    "RIGHT_MASTER")
    #define the properties of the master area
    X=$LEFT_MARGIN
    Y=$TOP_MARGIN
    #get whatever width is left
    W=$((WIDTH - MASTER_WIDTH -USELESS_GAPS))
    #the height would be equally shared by the non master windows
    H=$(((HEIGHT -TOP_MARGIN -BOTTOM_MARGIN )/(WINDOWS_IN_DESK-1) -TITLE_BAR_HEIGHT -USELESS_GAPS))
    i=0
    while [ "$i" -le "$WINDOWS_IN_DESK" ] ; do
    #avoid setting the attributes of the active window
    if [[ "${WIN_XID[$i]}" -ne "$ACTIVE_WIN" ]] ; then
    #set the attributes
    wmctrl -i -r ${WIN_XID[$i]} -e "0,$X,$Y,$W,$H"
    #set the Y co-ordinate for the next window.
    Y=$((Y+H+TITLE_BAR_HEIGHT+USELESS_GAPS))
    fi
    #preselect the next window
    i=$((i+1))
    done
    #set the co-ordinates for the MASTER_WINDOW
    X=$((W+USELESS_GAPS))
    Y=$TOP_MARGIN
    W=$MASTER_WIDTH
    H=$(( HEIGHT -TOP_MARGIN - BOTTOM_MARGIN -TITLE_BAR_HEIGHT -USELESS_GAPS))
    #set the active window to the "master "area
    wmctrl -r :ACTIVE: -e "0,$X,$Y,$W,$H"
    "TOP_MASTER")
    #define the properties of the master area
    X=$LEFT_MARGIN
    Y=$TOP_MARGIN
    #set the width taking into acount the margins
    W=$((WIDTH-LEFT_MARGIN-RIGHT_MARGIN))
    H=$MASTER_HEIGHT
    #set the active window to the "master "area
    wmctrl -r :ACTIVE: -e "0,$X,$Y,$W,$H"
    #set the y co-ordinate
    Y=$((Y+H+USELESS_GAPS+TITLE_BAR_HEIGHT))
    #Distribute the width amon the remaining windows
    W=$((W/(WINDOWS_IN_DESK-1)))
    #set the new height
    H=$((HEIGHT-MASTER_HEIGHT-TOP_MARGIN-BOTTOM_MARGIN-TITLE_BAR_HEIGHT-USELESS_GAPS))
    i=0
    while [ "$i" -le "$WINDOWS_IN_DESK" ] ; do
    #avoid setting the attributes of the active window again
    if [[ "${WIN_XID[$i]}" -ne "$ACTIVE_WIN" ]] ; then
    #set the attributes
    wmctrl -i -r ${WIN_XID[$i]} -e "0,$X,$Y,$W,$H"
    #set the X co-ordinate for the next window.
    X=$((X+W+USELESS_GAPS))
    fi
    #preselect the next window
    i=$((i+1))
    done
    "BOTTOM_MASTER")
    #define the properties of the master area
    X=$LEFT_MARGIN
    Y=$TOP_MARGIN
    #Distribute the width among the non master windows
    W=$(((WIDTH-LEFT_MARGIN-RIGHT_MARGIN)/(WINDOWS_IN_DESK-1)))
    #set the new height
    H=$((HEIGHT-MASTER_HEIGHT-TOP_MARGIN-BOTTOM_MARGIN-TITLE_BAR_HEIGHT-USELESS_GAPS))
    i=0
    while [ "$i" -le "$WINDOWS_IN_DESK" ] ; do
    #avoid setting the attributes of the active window again
    if [[ "${WIN_XID[$i]}" -ne "$ACTIVE_WIN" ]] ; then
    #set the attributes
    wmctrl -i -r ${WIN_XID[$i]} -e "0,$X,$Y,$W,$H"
    #set the X co-ordinate for the next window.
    X=$((X+W+USELESS_GAPS))
    fi
    #preselect the next window
    i=$((i+1))
    done
    #set the co-ordinates
    X=$LEFT_MARGIN
    Y=$((Y+H+USELESS_GAPS+TITLE_BAR_HEIGHT))
    W=$((WIDTH-LEFT_MARGIN-RIGHT_MARGIN))
    H=$MASTER_HEIGHT
    #set the active window to the "master "area
    wmctrl -r :ACTIVE: -e "0,$X,$Y,$W,$H"
    "GRID")
    #find the number of windows in the top row and in each subsequent row except for the bottom row.
    NORMAL_ROW_WINDOWS=$((WINDOWS_IN_DESK/NUMBER_OF_ROWS))
    #the bottom row ould have as many windows as the top row and any left over
    BOTTOM_ROW_WINDOWS=$((NORMAL_ROW_WINDOWS + WINDOWS_IN_DESK%NUMBER_OF_ROWS))
    WINDOWS_NOT_IN_BOTTOM_ROW=$((WINDOWS_IN_DESK-BOTTOM_ROW_WINDOWS))
    #set the co-ordinates for the top row
    X=$LEFT_MARGIN
    Y=$TOP_MARGIN
    #the height of each window would remain the same regardless of which row it is in
    H=$(((HEIGHT-TOP_MARGIN-BOTTOM_MARGIN)/NUMBER_OF_ROWS - TITLE_BAR_HEIGHT))
    #Find the width of each window in the top row, this would be the same for each row except for the bottom row which may contain more windows
    NORMAL_ROW_WIDTH=$((((WIDTH-LEFT_MARGIN-RIGHT_MARGIN)/NORMAL_ROW_WINDOWS)-USELESS_GAPS*NORMAL_ROW_WINDOWS))
    BOTTOM_ROW_WIDTH=$((((WIDTH-LEFT_MARGIN-RIGHT_MARGIN)/BOTTOM_ROW_WINDOWS)-USELESS_GAPS*NORMAL_ROW_WINDOWS))
    #start counting from zero
    i=0
    #we havent processed any windows yet
    CURRENT_ROW_WINDOWS=0
    #we will be processing the 1st row
    CURRENT_ROW=1
    while [ "$i" -le "$WINDOWS_IN_DESK" ] ; do
    if [[ "$CURRENT_ROW" -lt "$NUMBER_OF_ROWS" ]]; then
    if [[ "$CURRENT_ROW_WINDOWS" -eq "NORMAL_ROW_WINDOWS " ]]; then
    CURRENT_ROW=$((CURRENT_ROW+1))
    if [[ "$CURRENT_ROW" -eq "$NUMBER_OF_ROWS" ]] ; then
    X=$LEFT_MARGIN
    Y=$((Y+H+TITLE_BAR_HEIGHT+USELESS_GAPS))
    W=$BOTTOM_ROW_WIDTH
    else
    CURRENT_ROW_WINDOWS=0
    fi
    fi
    if [[ "$CURRENT_ROW_WINDOWS" -eq "0" ]] ; then
    X=$LEFT_MARGIN
    W=$NORMAL_ROW_WIDTH
    if [[ "$CURRENT_ROW" -ne "1" ]]; then
    Y=$((Y+H+TITLE_BAR_HEIGHT+USELESS_GAPS))
    fi
    fi
    fi
    wmctrl -i -r ${WIN_XID[$i]} -e "0,$X,$Y,$W,$H"
    X=$((X+W+USELESS_GAPS))
    CURRENT_ROW_WINDOWS=$((CURRENT_ROW_WINDOWS+1))
    i=$((i+1))
    done
    "MAX")
    X=$LEFT_MARGIN
    Y=$TOP_MARGIN
    H=$((HEIGHT-TOP_MARGIN-BOTTOM_MARGIN))
    W=$((WIDTH-LEFT_MARGIN-RIGHT_MARGIN))
    i=0
    while [ "$i" -le "$WINDOWS_IN_DESK" ] ; do
    #avoid setting the attributes of the active window
    if [[ "${WIN_XID[$i]}" -ne "$ACTIVE_WIN" ]] ; then
    #set the attributes
    wmctrl -i -r ${WIN_XID[$i]} -e "0,$X,$Y,$W,$H"
    fi
    #preselect the next window
    i=$((i+1))
    done
    #now that all the windows have been set set the master on top
    wmctrl -r :ACTIVE: -e "0,$X,$Y,$W,$H"
    "VERTICAL_SPLIT")
    X=$LEFT_MARGIN
    Y=$TOP_MARGIN
    H=$((HEIGHT-TOP_MARGIN-BOTTOM_MARGIN))
    W=$(((WIDTH-LEFT_MARGIN-RIGHT_MARGIN)/WINDOWS_IN_DESK - USELESS_GAPS))
    i=0
    while [ "$i" -le "$WINDOWS_IN_DESK" ] ; do
    wmctrl -i -r ${WIN_XID[$i]} -e "0,$X,$Y,$W,$H"
    #preselect the next window
    X=$((X+W+USELESS_GAPS))
    i=$((i+1))
    done
    "HORIZONTAL_SPLIT")
    X=$LEFT_MARGIN
    Y=$TOP_MARGIN
    H=$(((HEIGHT-TOP_MARGIN-BOTTOM_MARGIN)/WINDOWS_IN_DESK -TITLE_BAR_HEIGHT -USELESS_GAPS))
    W=$((WIDTH-LEFT_MARGIN-RIGHT_MARGIN))
    i=0
    while [ "$i" -le "$WINDOWS_IN_DESK" ] ; do
    wmctrl -i -r ${WIN_XID[$i]} -e "0,$X,$Y,$W,$H"
    #preselect the next window
    Y=$((Y+H+TITLE_BAR_HEIGHT+USELESS_GAPS))
    i=$((i+1))
    done
    esac
    #say bye
    exit 0
    I call the script using the openbox key bindings for example:
    <keybind key="W-g">
    <action name="Execute">
    <command>/home/default/bin/wmtiler.sh -g</command>
    </action>
    </keybind>
    The advantage this holds, in my case, is that it provides me with on demand automatic tiling with a momentary spike in CPU usage but no sustained RAM usage.
    This should work on all window managers in which wmctrl works.
    Of course  there are plenty of things still to do and many bugs to fix, some of which are documented in the script itself
    Nothing would make me happier if somebody else found this useful.

    Hmmm.... iconified windows should be totally ignored. Could you post the output of xwininfo for the iconified window? for example;
    Get tet a list of windows open by issuing the wmctrl -lxG command
    [default@arch_desktop ~]$ wmctrl -lxG
    0x01400001 -1 4 0 1911 26 Conky.Conky arch_desktop conky
    0x01a00024 0 1346 52 576 254 surf.surf arch_desktop 24Online Client
    0x0200066a 1 1345 54 569 483 terminal.Terminal arch_desktop Terminal - default@arch_desktop:~
    0x02001231 1 1345 538 569 483 terminal.Terminal arch_desktop Terminal - default@arch_desktop:~
    0x02200004 -1 0 971 1920 109 avant-window-navigator.Avant-window-navigator arch_desktop avant-window-navigator
    0x01200039 1 0 18 1344 1026 chromium.Chromium arch_desktop Post a reply / Arch Linux Forums - Chromium
    0x0200279f 0 2 52 933 431 terminal.Terminal arch_desktop Terminal - default@arch_desktop:~
    and taking the window x id of the minimized surf window and issuing the xwininfo command:
    [default@arch_desktop ~]$ xwininfo -id 0x01a00024
    xwininfo: Window id: 0x1a00024 "24Online Client"
    Absolute upper-left X: 1345
    Absolute upper-left Y: 34
    Relative upper-left X: 1
    Relative upper-left Y: 18
    Width: 576
    Height: 254
    Depth: 24
    Visual: 0x21
    Visual Class: TrueColor
    Border width: 0
    Class: InputOutput
    Colormap: 0x20 (installed)
    Bit Gravity State: NorthWestGravity
    Window Gravity State: NorthWestGravity
    Backing Store State: NotUseful
    Save Under State: no
    Map State: IsUnMapped
    Override Redirect State: no
    Corners: +1345+34 --1+34 --1-792 +1345-792
    -geometry 576x254--2+16
    As you can see, for me , the "Map State:" is  "IsUnMapped" for the iconified windows and this set of commands is exactly what I am doing to ignore iconified windows. What I need to know is that is there some other type of map state that I need to ignore.
    As for the feature requests I already had it in my mind to do the first three points that you mentioned. Since the script is intentionally designed not to run as a background process, there has to be some sort of a backing store like maybe a simple text file in which to save the state and read it from there on the next command invocation. The advantage would be it would take a momentary spike in CPU utilization and no sustained RAM utilization like I mentioned before. Disadvantage being the user would have to issue a command to actually get the tiling done.
    Regarding your fourth point, did you mean setting the window to 50% width automatically on moving it to the screen edge like it is done in KWIn and Win7? If you want it to be done automatically then that would involve tracking the movement of the mouse and windows on the screen continuously. This is something I'd rather do in some other, tinier faster, script and call this script from that on specific events.
    However, if you are willing to press a key while focused on a window and have it resized to max height and 50% of screen width either on the right side or on the left side, depending on the key combination, while leaving the other windows unaffected, then that can be arranged very simply. 

  • EP6.0 SP2 startup/shutdown scripts for Windows/MMC

    Does anyone have scripts to automate the starting/stopping of EP6.0?  I'm using the Startup Framework to start/stop EP6.0 manually but need an automated process to use for scheduled backups.  There is a document called "Startup and Shutdown of Enterprise Portal 6.0 SP2" that specifies the command "shutdown -h localhost:<p4 port>" which shuts down the portal but the processes automatically restart.  I've tried using jcontrol in a batch file to start the portal but the red-yellow-green status in MMC does not reflect the status of the portal when it's started outside MMC.  Any feedback would be welcome.
    Kind regards,
    Rex L. Farris

    Hi Rex,
    please have a look at the note 748713: Central note - Usage of startup framework with EP 60 SP2.
    It states that unattendes shutdown is not supported in Windows Environment.
    Anyway you can:
    - follow the hint suggested in the note to manage start / stop of the portal;
    - use startsap / stopsap commands with this syntax:
       stopsap name=<instance> nr=<nr> SAPDIAHOST=<hostname>
    Hope this can help,
    Regards,
    Alessandro.

  • How do you either set "Show More Tiles" or Start Screen rows via command line or script for Windows 8.1?

    Is there a method to change the Start Screens number of rows (similar to Windows 8.0's use of the Explorer\Scaling\MonitorSize in registry). Possibly by forcing the switch for "Show More Tiles" via script etc? This is to enable the device with
    Windows 8.1 to be built using a deployment methodology like SCCM and have the Tiles correctly configured as required for a standard look and feel across devices. I do not know why all these switches are not represented in either WMI or the registry to enable
    the customization of look and feel out of the box for enterprise deployments.
    Thanks for any assistance possible.

    Hi,
    You can try steps in this article.
    How to Change Number of Apps Tile Rows on "Start" Screen in Windows 8 and Windows 8.1
    http://www.eightforums.com/tutorials/2690-start-screen-metro-apps-change-number-rows-windows-8-a.html
    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,
    Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you
    completely understand the risk before retrieving any software from the Internet.
    Hope this could be helpful.
    Kate Li
    TechNet Community Support

  • TREX startup/shutdown script for Windows 2003

    Hi ,
    I am looking for a script that would do a startup/shutdown of TREX servers/services on  Windows 2003.  I am not sure if I have posted this on the right forum.  Also, why is the TREX hanging and going into a dormant mode when not used?
    Is there a SAP note for the above.
    Would really appreciate any assistance.
    Thank you.
    Ramesh Srinivasan.

    Hi again,
    sorry my bad, I misunderstood your question. Indeed what the script does now is wait for the different components of BIEE to start and stop, whatever time they take for that. On my system (a dual-quad DL380 with 64GB RAM) the whole process still takes about 4 min. However this should not be too much of a pb to you since this BI reboot operations should really be exceptional, not much more frequent than system or database reboots in fact.
    On the other hand the BI processes restart from within Fusion Middleware Control are much more frequent and should be much quicker (about a couple dozen seconds).
    Maybe by looking at the startup logs (/var/log/obiee-start.log) you may identify some time-consuming operation. I remember that during initial setup I had some long timeouts when the managed server tried to contact the admin server on port 7001 and could not for whatever reason (firewall for instance). One thing to do might be to watch the startup process in real time by monitoring the log file (tail -f /var/log/obiee-start.log).
    Hope this helps,
    Chris

  • Scripting for Windows Server Backup for Exchange 2010

    Hi,
    I'm new to writing scripts and was wondering if anyone could assist with writing a script to backup an Exchange Server in a windows 2008 r2 environment.  I currently use Windows Server Backup with a full VSS backup to run exchange backups, however,
    each backup overwrites the previous one, and i would really like to have multiple backups.  I would also like  to specify backup log locations, and have emails sent upon successful backups or failed backups.  I am trying to write this powershell
    but cant seem to get things to work.
    Thanks
    Debbian

    You can use PowerShell in conjunction with the Windows Backup command line utility, wbadmin.exe. The code below should help get you started. I have included the date in order to help maintain multiple back ups, but if you do more than one back up per day,
    you will need to change the date format to include the time. You cannot control the built in logging of Windows Backup, but you could collect your own backup information and write that out to a text file. As far as sending emails, look into the Send-MailMessage
    cmdlet including the -Attachment parameter that could send your log file with your mail message. Cheers.
    $Date = Get-Date -Format 'MM-dd-yyyy'
    $Path = "\\server\share\$Date"
    New-Item -Path $Path -ItemType Directory | Out-Null
    Start-Process wbadmin.exe -ArgumentList "start backup -backupTarget:$Path -allCritical -vssFull -quiet"

  • Looking for a One to Many script to extend the system partition for Windows 7 machines

    Looking for a One to Many script to extend the system partition for Windows 7 machines

    Pre-written scripts can be found in the repository:
    http://gallery.technet.microsoft.com/scriptcenter
    If you can't find what you need, you can request a script (no idea if anyone ever bothers to fulfill these requests though, I know I don't):
    http://gallery.technet.microsoft.com/scriptcenter/site/requests
    Let us know if you have any specific questions.
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • Apple script for Message box when Mail app Compose Window Opens

    Hi there
    I'm trying to make mail app remind me to choose the right emaill address to send from since I have several email addresses. Is there a way I can make or write an apple script for a message box to pop up whenever mail app's compose window opens up.
    I can do for the case when I actally click the compose button when I'm on mail app by using UI scripting. But when it comes to hyperlinks which opens up the compose window, it fails.
    I just want a script to see whether the compose window is open and if open pop up a message box.
    Thanks
    Best regards
    Zam Shabeer Thahir

    TaoChitpol wrote:
    By the way, the problem happens with the account of MS Exchange service, I don't know if this is the cause of the problem.
    I think yes.  The encoding is being corrupted somewhere, probably Exchange.  There is nothing you can change on the iPad other than the OS languagel, to see if that helps.  You can also tell Apple at
    http://www.apple.com/feedback/

  • How can I download a Generic Post Script printer Driver  for Windows 7 .

    How can I download a Generic Post Script printer Driver  for Windows 7

    We used to install this PostScript printer  for previous Windows releases from
    (winsteng) and run it to install the driver from the below location
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=1500
    This doesnt work with Win 7 (The install crashes ) , Basically looking to do the same process with Win 7

Maybe you are looking for

  • Best Material Type for Handling Non-valuated Materials in Distribution

    Our distribution business will soon be handling non-valuated material and I am trying to determine the best material type to use.  I am considering material type UNBW but would like to know if anyone has advice.  We are strictly providing a service t

  • Which one do you recomend Tech Tool or DiskWarrior

    i want to buy one of this programs to solve problems, but i'm not sure which of them is best. thanks.

  • Calling a report in bapi

    Hi.. i have copied and modified standard bapi bapi_quotation_createfromdata. Ihave got a program in se38 as yragtest4.. i need to call this report in my bapi and should be able to run from bapi.. Raghu

  • OHJ Error Msg

    Hello, I have Oracle 9.2.0.1.0 and developer suite release 2 9.0.2.0.0 installed on Red Hat 8. I did a full install of Developer and after a few fixes it installed ok. I installed it to a new ORACLE_HOME. When I use it I have to switch to the develop

  • How do you capture a screen shot

    how do you capture a screen shot on a MacBook Air