General discussion

  • Creator
    Topic
  • #2092338

    I have a doubt in VB Script

    Locked

    by inbarasank ·

    Hi,
    I have a doubt.is it possible to get the Server by executing the script in the client in VB script.If so please tell me how to write the script.Can anyone tell me which is the location in the registry in which NT stores the current Reg size andthe set reg size.
    Please flow ur inputs to me which will be very helpful to me.
    Rgds
    Inbarasan

All Comments

  • Author
    Replies
    • #3878520

      I have a doubt in VB Script

      by shanghai sam ·

      In reply to I have a doubt in VB Script

      You can use registry API calls to retrieve the information you want, although I’ve never tried it from VBScript. You might try encapsulating the API calls in a VB DLL and using the DLL from VBScript. However, there may be a class that will do the quering for you and return the results.

      Try RegConnectRegistry to specify what machine you want to connect to, then the standard RegOpenKeyEx, RegQueryValueEx and RegCloseKey to get the information you want.

      The information you’re looking for, according to MSDN, is somewhere in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control key, but I haven’t been able to find out anything more specific than that.

      Hopefully this will get you started.

      Glen

    • #3878511

      I have a doubt in VB Script

      by glen_mcleod ·

      In reply to I have a doubt in VB Script

      I got disconnected. That’s my answer above.

      Glen

      • #3878428

        I have a doubt in VB Script

        by glen_mcleod ·

        In reply to I have a doubt in VB Script

        I just found something in the WMI classes (Windows Management Instrumentation) that might solve this. Using WSH (Windows Scripting Host) you can connect to the WMI objects and use the ‘StdRegProv’ class to perform most of the API calls I mentionned.

        Glen

      • #3879634

        I have a doubt in VB Script

        by inbarasank ·

        In reply to I have a doubt in VB Script

        Hi,
        I am starter in VB script.Can u just tell me how to connect to the WMI objects and use the ‘StdRegProv’ class to perform most of the API calls I mentionned.
        If u could write the code and send me,it will be very useful to me.
        Rgds
        Inbarasan

    • #3878435

      I have a doubt in VB Script

      by gicu artistu’ ·

      In reply to I have a doubt in VB Script

      If you’re talking about the client side script, I don’t know of any method that could get to the server from the client side(aside from writing a plugin that is then embedded in a page and this plugin could have methods to get to the server, document.plugin.method[go to server and do something]).
      If you’re talking ASP then you could write ASP code that could instantiate a COM obj and pass some results from those obj to the client script (but this happens before the html response is pushed to the client.


      <%= text.GetString("TITLE") %> //server code


    • #3870144

      I have a doubt in VB Script

      by astute ·

      In reply to I have a doubt in VB Script

      Can u reformat the question, what do u mean by “get the server by executing the script”?

      Location in registry for Reg Size

      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\RegistrySizeLimit

      • #3869960

        I have a doubt in VB Script

        by inbarasank ·

        In reply to I have a doubt in VB Script

        Hi,
        There is no key like that in the registry.Can U please check it and tell me.
        Rgds
        Inbarasan

    • #3868697

      I have a doubt in VB Script

      by rory.plaire ·

      In reply to I have a doubt in VB Script

      Hi Inbarasan,

      I think there was a space in the above key, but even if you detected it, there is the probability that the value doesn’t exist, which makes Windows NT/2k dynamically adjust the registry settings according to the document at http://msdn.microsoft.com/library/psdk/winbase/regapi_02jj.htm .

      I’d also like to have a little more insight into the problem you are facing, so that the reply could fit that which is needed, and not have you confused by my rambling about a situation thatis half understood.

      cordially,
      -rory

      • #3868468

        I have a doubt in VB Script

        by inbarasank ·

        In reply to I have a doubt in VB Script

        Hi rory,
        I will explain my problem.I am writing a VB script for taking Repair disk.I wrote the script for executing the script for Rdisk process.Now i need to give some conditions only then it should work.For the same i need the help.In VB script how to get the time from the Remote machine.Why i need this we want to have one machine as time server and i want to execute the script if the day and time matches from time server before executing the script in the clients.
        Now i need ur helpin how to get the time and day from remote machine.
        The reg key which u said i couldn’t be able to find in Winnt 4.0 as well as win2k.I am expecting ur reply.
        Rgds
        Inba

    • #3882354

      I have a doubt in VB Script

      by ewing bettles ·

      In reply to I have a doubt in VB Script

      One way to find the time on a particular NT machine located in the network – call a shell command script (*.cmd or *.bat) that redirects its output to a file for the following shell command:

      NET TIME \\

      Replace with the NetBIOS name of your time server. Parse the output file within your script for the time setting.

      Good luck, -Ewing

      • #3882217

        I have a doubt in VB Script

        by inbarasank ·

        In reply to I have a doubt in VB Script

        Hi,
        I can try this.I need one more help,If i want to take the machine name i can use net view.How will take the file and put it in the script.If u could show me in small script to me it would of very great help.Please help me.
        Luv
        Inba

    • #3882864

      I have a doubt in VB Script

      by myjunk ·

      In reply to I have a doubt in VB Script

      to get the servers time you could try using ASP. It is the same as VBScript, but is executed on the server side instead of the client side. Try the following…

      You can view and download the source-code of an example of this by going to http://www.rapid-tel.com/servertime.asp

    • #3883332

      I have a doubt in VB Script

      by rory.plaire ·

      In reply to I have a doubt in VB Script

      Hi Inbarasan,

      Again, reread my post. It is normal _not_ to have the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\RegistrySizeLimit key and value in your registry, as you may have to add it. Do this: open Regedit.exe, expand the keys HKLM, System and CurrentControlSet. Right click on Control key under CurrentControlSet. Select New -> DWORD Value. Set the new _value_ (don’t rename yet) to 8 hex (or decimal). This means 8 megabytes, the default value. You should really edit the data to be the value of the size of the current registry, or it may read this new value after renaming and do all sorts of bad things. When you are confident that you have the size set OK, then rename it the value by right-click -> rename. Call it RegistrySizeLimit. Close Regedit. This will work for one part of your problem, I’ll get back to you on the other part, hopefully, having to do with the VB script and launching NET TIME \\servername in an object. If someone else can help Inbarasan, please go forit, since it may be quite a work to help him — he asks exacting questions!

      happily,
      -rory 8)

    • #3696626

      I have a doubt in VB Script

      by inbarasank ·

      In reply to I have a doubt in VB Script

      This question was auto closed due to inactivity

Viewing 8 reply threads