+ Reply to Thread
Results 1 to 7 of 7

Thread: Set Computer Name

  1. #1

    Default Set Computer Name

    I need to set the computer name during installation. Does anyone know if I can do this through registry or something? Any tips welcome.

  2. #2
    Join Date
    Mar 2004
    Location
    Eden, Australia
    Posts
    41

    Default Re: Set Computer Name

    Hi Sphair,

    I don't know if it's as simple as a registry entry but I suspect not because I found an API called SetComputerName. I haven't tried it but I expect it's what you want. If this is the case, unless Friedrich adds it as a function you would have to write it into a short DLL and call the function. Let me know if you need any help, the API looks pretty easy and Friedrich's DLL's are a dream.

    Best Regards,
    Geoff Spillane
    Data Down Under

  3. #3
    Join Date
    Mar 2004
    Posts
    4,308

    Default Re: Set Computer Name

    You can do the following:

    1) Set Variable %NEWCOMPUTERNAME% to YourNewComputerName
    2) Use "Call DLL Function" with the following parameters:

    Library: kernel32.dll
    Function: SetComputerNameA
    Calling Convention: __stdcall
    Parameter Types: *string
    Function Parameters: %NEWCOMPUTERNAME%

    If the function succeeds, the %_SB_RETURN% value is a nonzero value.

    Applications using this function must have administrator rights. You have to reboot the machine.

    Does this help?

  4. #4
    Join Date
    Mar 2004
    Location
    Eden, Australia
    Posts
    41

    Default Re: Set Computer Name

    Hi Friedrich,

    This is great. Does this mean that I can call most API functions direct from their Windows DLL without having to go through the hassle of prototyping, creating a lib, and a Clarion DLL etc?

    Best Regards,
    Geoff Spillane
    Data Down Under

  5. #5
    Join Date
    Mar 2004
    Posts
    4,308

    Default Re: Set Computer Name

    Hi Geoff,

    Yes, that's correct ;-) You can directly call most Windows API functions from within the script. And of course, you can add your own DLLs (unlimited number) and call into your own functions.

    Thanks,

  6. #6

    Default Re: Set Computer Name

    Calling into DLLs works like a charm yes. We use this alot in our installation script.

    But maybe it would be an idea to implement (later, not now a function which reflects the Get System Information, which is called Set System Information, which lets you select from a dropdown common system configurations settings like Set Computer Name.

  7. #7
    Join Date
    Mar 2004
    Posts
    4,308

    Default Re: Set Computer Name

    Thank you for your suggestion. Good idea. It's on the drawing board now

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Information Please
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 9
    Last Post: 12-21-2006, 03:38 AM
  2. SetupBuilder 6.0 Change Log [December 08, 2006]
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 14
    Last Post: 12-10-2006, 06:32 AM
  3. SetupBuilder 6.0 Change Log [November 30, 2006]
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 8
    Last Post: 12-01-2006, 05:42 AM
  4. Welcome screen
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 6
    Last Post: 03-21-2006, 01:25 AM

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •