to replace exe of a node from another node in a network thru vb coding

  • hi, i m working in a company who r using Two- tier technology.

    Sometime i will be insisted to change the latest exe in all of the nodes of the network, This is uneasy for me because  there are lot of nodes placed in a zigzag manner...

    So, i want to create program which will take the node no and the path of the latest exe as input and replace it in c: of all the nodes (the exe will be in the c: of each and every node)..

    For this, i want to do 2 things, they are:

    1. I want to check whether the node is currently working or not.

    2. I want to check whether the application(exe that i m going to change) is running in that particular node. if yes means i want to close it ..

    If i get idea to  do these 2 things, lot of burden will be reduced in my work

    CAN ANYBODY HELP ME

     

  • Sounds like you're going to need to write a script using WSH. That's outside the bounds of this site, but here are some things you can do.

    1) Node currently working

    Do you just need to check if the node is up and available? If so, you can issue a ping test:

    Microsoft Script Center: Verify Computer Availability

    2) Application running or not

    You check the running processes to find out if the app is running and then terminate it. This script gives you how to terminate the process. It first queries to see if any processes are running and then systematically goes through and kills them. The example given is notepad.exe... you'd just need to modify it to your application name.

    Microsoft Script Center: Terminate a Process

    HTH.

    K. Brian Kelley
    @kbriankelley

  • sorry kelly,                                                                   i can't get u..                                                         where do i want to execute the specified query..           esp.,Select * from Win32_PingStatus and Select * from Win32_Process

     

  • When writing your script, do the following:

    1) Check to see if the servers are online. You can use Win32_PingStatus to do so.

    2) Check to see if the process of the old .exe is running. You can use Win32_Process to see if this is the case. If it is, terminate the process (the script I linked to shows how to do both).

    3) Proceed with your copies for those servers which are on-line.

    K. Brian Kelley
    @kbriankelley

  • Sorry kelley,

    When i m running those statements in the sql server, there exists an error message "Invalid object name ....".  Wat 2 do now.

  • You wouldn't run them in SQL Server. This can be done in SQL Server but it's much harder. You should put together a VBScript code which you'd run from the command line. The code samples I gave you links to do just about all the work for you.

    K. Brian Kelley
    @kbriankelley

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply