We are trying to retrieve the computer name on a single line.
The command I am using is inserting this with preceding text on the line:
ipconfig/all | find "Host Name" >c:\whoami\whoami2.txt
produces
Host Name . . . . . . . . . . . . : MyPCName
but we are trying to have the txt file read:
MyPCName
I am getting close with FART
fart c:\whoami\whoami2.txt " Host Name . . . . . . . . . . . . : "
...but the output includes a space before the PC Name
Any advice on removing the entire string before the PC Name?
The FART app is really excellent, in case you are unfamiliar with it, available from:
http://fart-it.sourceforge.net/
and it stands for Find And Replace Text
Deleting Part of a String That Includes Spaces
Moderator: DosItHelp
-
- Posts: 6
- Joined: 26 Sep 2016 15:02
Re: Deleting Part of a String That Includes Spaces
Why are you not using the environmental variable %COMPUTERNAME%
Re: Deleting Part of a String That Includes Spaces
mungurk@gmail.com wrote:The FART app is really excellent, in case you are unfamiliar with it, available from:
http://fart-it.sourceforge.net/
and it stands for Find And Replace Text
As you have been shown in your previous thread we already have a pretty slick find and replace app.
-
- Posts: 6
- Joined: 26 Sep 2016 15:02
Re: Deleting Part of a String That Includes Spaces
%computername% clearly had gone out of my head - thanks, I needed that!