Saturday, December 29, 2012

autoDial script for Windows

This is my personal script or batchfile because my connection is not that reliable or should I say the connection sometimes stops working. So I created this script from various sites to complete it.
Sorry I got lazy what sites are the sources but I just searched how to dial using command prompt.

This script runs in msdos shell and uses rasdial to control the dial up and there is an existing dial up account named Sun before creating this script. See the script I made below...

@echo off
:goagain

ping www.google.com | find "TTL"

if ERRORLEVEL 1 goto reconnect
if ERRORLEVEL 0 goto lineok

:reconnect
echo Disconnected
rasdial Sun /disconnect
rasdial Sun

:lineok
echo line ok
echo Waiting for 50 seconds before checking connection again...
PING 1.1.1.1 -n 50 -w 1000 >NUL
goto goagain


This script filename is autodial.bat

As the script goes the @echo off line hides the commands,
the  ping www.google.com | find "TTL" is to check if the connection gets a ping reply,

the rasdial [connection name] connects the internet
and adding /disconnect disconnects the internet.

the PING 1.1.1.1 -n 50 -w 1000 >NUL is the delay command where it will wait for 50 seconds before going to the next line.


Also this script goes on an endless loop so to stop the script just either close the command prompt window or press ctrl + c to cancel the script.


Hope this small script may help others in any way. Happy Holidays!!!

Tuesday, November 13, 2012

Multi-Boot PE using Grub4Dos

Thanks to the sources below on how I completed this project of mine...
http://www.rmprepusb.com/tutorials/ubuntu
http://www.themudcrab.com/acronis_grub4dos.php#tagInstall
http://www.rmprepusb.com/tutorials/grub4dos#TOC-Part-1---Making-a-bootable-USB-pen-
http://www.rmprepusb.com/tutorials/install-xp-from-an-iso
http://www.dedoimedo.com/computers/grub.html


Setup Prerequisites...
Setup environment: Windows
Items needed:
  • usb-HDD (at least 80GB)
  • Grub4DOS Installer (http://www.themudcrab.com/acronis_grub4dos.php#tagInstall)

HDD Setup Layout:
Note: This can be accomplished doing 1 partition where there will be less issues. But I prefer organizing my boot partition from my installer partition.
  • Boot Partition = 16GB / FAT32
  • Data Partition = rest of the space / NTFS

Start of Grub installation:
  • After creating the partition on the HDD whether a whole or 2 partition like mine run the windows application grub_gui (see the above link themudcrab site)
  • Use Whole disk (MBR)
  • Then check the Don't search floppy option, leave all the other options unchecked.
  • Click on Install
  • After a successful write copy the grldr file to the root of the partition or your usb hdd
  • Now create your menu.lst to create a menu for grub
How to Boot XP or BartPE
See below the sample menu entry to load ntldr
title  Boot BartPE       
find --set-root --ignore-floppies --ignore-cd /ntldr
map () (hd0)
map (hd0) ()
map --rehook
find --set-root --ignore-floppies --ignore-cd /ntldr
chainloader /ntldr


How to Boot Win7/Vista or WinPE2+
See below the sample menu entry to load bootmgr
title  Boot WinPE/Vista/Win7
find --set-root --ignore-floppies --ignore-cd /bootmgr
map () (hd0)
map (hd0) ()
map --rehook
find --set-root --ignore-floppies --ignore-cd /bootmgr
chainloader /bootmgr



In the menu above my BartPE and WinPE2/3/Win7 data is also on the boot partition. Note that the ntldr and bootmgr are all in the root of the partition.

This is my birthday gift to you people! Happy birthday to me! :p

Thursday, October 18, 2012

Multiple gateway in Windows

Ahoy! Been busy this past months and here I am again.

In this topic I experienced a problem where I have 2 NIC connected to different routers. One is I use for internet browsing (NIC1) and the other is for file sharing and other stuff (NIC2).

Now I need to use VPN to connect to NIC2 but the default gateway is on NIC1.Below is the current configuration...

NIC1 (default gateway)
IP = 192.168.10.50
Gateway = 192.168..10.1

NIC2
IP = 192.168.20.50
Gateway = 192.168..20.1

IP to connect from outside NIC2
192.168.1.20

Then from what I read from Microsoft Support it said that I need to add a static route to be able to route IP datagrams (whatever that is) to my specified destination.

To do that open command prompt and type...
route add 192.168.1.0 mask 255.255.255.0 192.168.20.1

where: ROUTE ADD destination subnet MASK subnet mask my gateway

then try to ping to the IP that you want and it should respond. If it works then VPN and other application you wish to use can connect to that destination.


Happy tweaking!!!