Jump to content











Photo
- - - - -

Does anybody know a tool/driver/utility for doing this?

boot hostname driver boot-start change computer-name

  • Please log in to reply
10 replies to this topic

#1 tinoy69

tinoy69

    Member

  • Members
  • 30 posts
  •  
    Philippines

Posted 25 July 2013 - 09:04 PM

I want to change the hostname/computer name of a backed up .IMG file with ntfs filesystem...

 

or specifically...

 

change the hostname/computer name of a .IMG file via boot scripts/boot driver/startup? to boot in a vm...

 

I just want to install that at startup(boot start), and then change the hostname (to get from a dhcp perhaps)

before system is up...

 

I know this can be done on some ISCSI commercial programs, i just don't know how they possibly do it...



#2 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 25 July 2013 - 11:16 PM

Hi Tinoy69,

 

You mean the computername right?

A vbs to do this via the Win32_ComputerSystem class and its rename function.

 

See here : http://msdn.microsof...5).aspx#methods

 

Regards,

Erwan



#3 tinoy69

tinoy69

    Member

  • Members
  • 30 posts
  •  
    Philippines

Posted 26 July 2013 - 01:35 AM

yes, i mean the computername, all methods i've know to change the computername after windows boots up requires a reboot, i want a solution to change the registry settings at boot time, before windows reads the registry for the computername, i want a solution specifically to change the computername on the fly, the only method i know that this could work is a boot time driver that changes the computername via dhcp command reading the hostname which windows ignores, but it will probably take a specialized boot driver



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 July 2013 - 08:05 AM

Well, the involved keys are known:

http://www.petri.co....mputer-name.htm

 

But you will need to first boot to *something else*, and then boot to the actual (with Registry modified) "real" OS.

In theory it shouldn't be a problem to make a very minimal PE of some kind that automatically runs a script making use of Erwan.l's nice little interface for the offline Regitstry library and reboot, but it will delay the actual booting by a couple or more minutes. 

http://reboot.pro/to...gistry-library/

http://reboot.pro/to...fline-registry/

 

:cheers:

Wonko



#5 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 26 July 2013 - 09:30 AM

indeed, in all cases, i believe an extra reboot would be required :

 

-boot to your real O.S, perform the change and reboot (use the runone registry key?)

or

-either boot to a winpe first (as Wonko mentionned) to perform an offline registry.

i have just written a thread on a several ways to make a minimalist winpe :http://reboot.pro/to...18744-quickpe4/

 

/erwan



#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 July 2013 - 03:36 PM

Yes, the suggestion for the PE is that it may be much faster in booting.

 

And you don't need a particularly "recent" PE, *any* will do, even - since the "target" should be always the *same* virtual machine, a very minimal XP based PE, possibly with Hybrid boot (faster) would do.

http://reboot.pro/topic/15252-picoxp/

 

Maybe it would be th eoccasion to go back to the development of a PrePE/LEECH PE:

http://reboot.pro/to...e-fast-boot-pe/

http://reboot.pro/to...icoxp/?p=151841

 

As a matter of fact, it might be possible also to:

boot to a DOS (with a NTFS driver AND a Windows NT registry editor) 

IF the "Computername" has the same length, do a direct disk editing from DOS or even from grub4dos.

 

If the latter is possible it would be a matter of a handful of seconds.

 

:cheers:

Wonko



#7 tinoy69

tinoy69

    Member

  • Members
  • 30 posts
  •  
    Philippines

Posted 26 July 2013 - 05:57 PM

i'm looking for a general solution, that's not only applicable in vm machines, i know the boot-driver solution exists because a iscsi product (that i'm not gonna name), is changing the hostname/computername by a presenting a dialog at boot time (i dunno if it's really boot time) to name the hostname...and it changes the hostname regardless of what's in the registry...if only i could name the product...but i guess i'm just shy to mention them...

 

@wonko: you mean to say that like if i set a computername "ZXZXZX", then image that partition, searching for just "ZXZXZX" in the image then changing all occurences "*might possibly*" change the computername if the image is restored?

 

if only i knew some driver developer, i could ask them if this can be possible from a boot-start driver...



#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 July 2013 - 06:21 PM

@wonko: you mean to say that like if i set a computername "ZXZXZX", then image that partition, searching for just "ZXZXZX" in the image then changing all occurences "*might possibly*" change the computername if the image is restored?

Yes, that's what I mean (though possibly the search in the registry - accessed as a RAW binary file - might be more complex than just searching for "ZXZXZX", just as an example it might search for "ZXZXZX" within (example) 64 bytes from a "hit" on "ComputerName" or "Eventlog", etc., but it should be both possible and scriptable.

 

Consider that among the code one can write, drivers are among the most complex ones, and the probability to find a programmer actually capable of developing a driver (and wishing to create that driver for free) are very, very low.

 

I mean, it would be far more simple to write a grub4dos program capable of parsing the Registry (since there are various source codes for this kind of app that should be more or less "portable") than to write a specific "driver" program.

 

Also, in SOME cases, it is possible to just change the Computer name (without rebooting) but YMMV :ph34r: :
http://timnew.github...without-reboot/

 

Edit:

Try this:

http://www.autoitscr...df/#entry823188

the function to renew the Environment seems interesting.

 

:cheers:

Wonko



#9 tinoy69

tinoy69

    Member

  • Members
  • 30 posts
  •  
    Philippines

Posted 26 July 2013 - 06:57 PM

i also know the link you've referred about the powershell script, that one also takes a reboot, the computername is cached on startup, any "edits" to the registry doesn't touch the cached computername windows keep, it will change the computername when you read from the registry but going to system properties, it still is the old computername before you've changed it...

 

also, think the search the image at boot time i think will take a lot of time...if the image file is large and coding just a search and replace, but if the program know's all of the offset, like (for example, 49 dword offset to change), it maybe possible and fast...

 

also if you changed the computername? doesn't windows compute a checksum or something like that, that if you changed the computername by search and replace on the image, it still might not boot?

 

still i thank you for the inputs, wonko, i'll try your suggestion, i'll try to search and replace the computername, see if it works...



#10 tinoy69

tinoy69

    Member

  • Members
  • 30 posts
  •  
    Philippines

Posted 26 July 2013 - 07:58 PM

wow, wonko, thanks a lot for the suggestion, it works...you have to change 25 occurences (that's the count on my image), of the computername in the image...after that booting again the image, presto! the computername has changed!

 

my image

nlited winxp sp3

formated with ntfs

image size: 5gb

 

used hxd editor to change the occurences of the computername

 

you have to search for the "unicode" of the computername: in replace->check "unicode"

 

thank you again wonko! now if only how to place this at boot-start...



#11 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 July 2013 - 08:48 AM

thank you again wonko! now if only how to place this at boot-start...

As I already hinted, you can use grub4dos (and of course a script for it) at boot time, before chainloading the NTLDR.

cat --hex (--locate=x --replace=y )

can do the same things a hex editor can do.

The "Unicode" is in 99.999% the "plain" char hexcode with a zero appended after each digit, not a problem.

 

The only issue (and the reason why this is much more a "hack" than a real solution is the risk of having "false positives" for "common names".

 

If the names your computer are like Yggdrasil, Mímameiðr, Léraðr, Bifröst  or Heimdallr :w00t: and your are NOT from the very north of Europe ;), then it is unlikely, but if they are like Johnny, MyPC, Computer, etc., there may be issues of collisions.

 

Still I would try that Autoit script before anything else. :unsure:

 

:cheers:

Wonko







Also tagged with one or more of these keywords: boot, hostname, driver, boot-start, change, computer-name

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users