Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-21-2011, 12:24 AM
night_hawke night_hawke is offline
Registered User
 
Join Date: Mar 2011
Posts: 19
Need to script changing local machine IP address

Is there a way to script securecrt to change my local ip address? I work on a network with multiple subnets, I need to be able to jump between them easily when i am locally on site.

I am hoping to have a script that i can use to change my ip address quickly. can anyone help?
Reply With Quote
  #2  
Old 03-21-2011, 09:31 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,219
Hi night_hawke,

There is nothing within SecureCRT's scripting API that would be helpful in accomplishing your objective. However, there is information from Microsoft that might be helpful.

The functionality you desire is built in to Windows WMI, so you could take advantage of the capability described on the MS Technet site here.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 03-21-2011, 11:11 PM
night_hawke night_hawke is offline
Registered User
 
Join Date: Mar 2011
Posts: 19
thanks for the reply!

I there a way to have it open a cmd window and send a command to do it from there?
Reply With Quote
  #4  
Old 03-22-2011, 10:47 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,219
Hello night_hawke,

No, there's nothing inherently available to SecureCRT that will help. However, as with any VBScript, you can launch almost any application from a script using the WScript.Shell object that's built-in to VB Scripting.

You can download the VBScript reference documentation from Microsoft's website here.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 04-16-2011, 05:58 PM
gokcell gokcell is offline
Registered User
 
Join Date: Oct 2007
Posts: 20
Ip Manual and Automatic Set for LAN and Wan

Hi,

Use below simple batch script.

This script is going to

1-Manual IP,Subnet,GW,DNS Configuration for LAN
2-Manual IP,Subnet,GW,DNS Configuration for WLAN
3-Automatic IP,Subnet,GW,DNS Configuration for LAN
4-Automatic IP,Subnet,GW,DNS Configuration for WLAN

Before starting this script you must sey your LAN and WLAN Network Name;

for thi script LAN name must be "Local Area Network"

and WLAN name must be "WLAN"

If you set path conf., you can also use this script everywhere.

Script name is ifconfig.bat

**************************************************
C:\Documents and Settings\access\Desktop>ifconfig /?

Guid:

ifconfig [/? /L /W /WD /LD]

Options:

[/L]: Enter Ip for LAN
[/W]: Enter Ip for WLAN
[/WD]: WLAN Automatic IP Set
[/LD]: LAN Automatic IP Set

Ornekler:

>ifconfig ... Show Guide Infor
>ifconfig /L ... Manual LAN Ip Configuration
>ifconfig /W ... Manual WLAN Ip Configuration
>ifconfig /LD ... Automatic LAN Ip Configuration
>ifconfig /WD ... Automatic WLAN Ip Configuration


This program developed by Goksel YANGIN


**************************************************

ifconfig.bat

**************************************************
@echo off
if "%1" == "" (
:usage
echo.
echo Guid:
echo.
echo ifconfig [/? /L /W /WD /LD]
echo.
echo Options:
echo.
echo [/L]: Enter Ip for LAN
echo [/W]: Enter Ip for WLAN
echo [/WD]: WLAN Automatic IP Set
echo [/LD]: LAN Automatic IP Set
echo.
echo Ornekler:
echo.
echo ^>ifconfig ... Show Guide Infor
echo ^>ifconfig /L ... Manual LAN Ip Configuration
echo ^>ifconfig /W ... Manual WLAN Ip Configuration
echo ^>ifconfig /LD ... Automatic LAN Ip Configuration
echo ^>ifconfig /WD ... Automatic WLAN Ip Configuration
echo.
echo.
echo This program developed by Goksel YANGIN
exit /b
)
if "%1" == "/?" goto usage
SET GO=%1
GOTO %GO%
:/L
set net="Local Net"
goto A
:/W
set net="WLAN"
goto A
:/WD
set net="WLAN"
goto B
:/LD
set net="Local Net"
goto B
:/S
set net="Local Net"
goto C
:A
@echo off
echo Enter Static Ip info please:
echo Ip#
set /p IP_Addr=

echo Subnet#
set /p Sub_Mask=
echo Gateway#
set /p D_Gate=
echo Dns1#
set /p dns1=
echo Dns2#
set /p dns2=
echo Wait please. Ip set in progress...
netsh interface ip set address %net% static %IP_Addr% %Sub_Mask% %D_Gate% 1 >nul
netsh interface ip set dns name=%net% source=static addr=%dns1% >nul
netsh interface ip add dns name=%net% addr=%dns2% >nul
rem pause
goto end
:C
netsh interface ip set address %net% static 152.152.32.82 255.255.255.0 152.152.32.1 1 >nul
netsh interface ip set dns name=%net% source=static addr=10.32.4.3 >nul
netsh interface ip add dns name=%net% addr=10.32.4.4 >nul
goto end

:B
@ECHO OFF
ECHO Ip and subnet automatic set...
netsh int ip set address name = %net% source = dhcp >nul
netsh int ip set dns name=%net% source=dhcp >nul
goto end
:end

**************************************************


Regards,

Goksel Yangin
Computer Engineer
Reply With Quote
  #6  
Old 12-23-2019, 01:19 PM
Maureen's Avatar
Maureen Maureen is offline
VanDyke Product Director
 
Join Date: Feb 2004
Location: Albuquerque, NM
Posts: 1,570
Quote:
Originally Posted by night_hawke View Post
thanks for the reply!

I there a way to have it open a cmd window and send a command to do it from there?
Local shell support has been implemented in SecureCRT 8.7*, which is in beta. The installer can be downloaded here:

https://www.vandyke.com/cgi-bin/rele...curecrt&beta=1

Maureen

* Must be running Windows 10 build 1809 or later (or Server 2019)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 09:46 PM.