Batch Script using System Varriable for Hostname and FQDN results in large space between

I have a batch script running on Windows 7 that I've created to help a physical computer, connect to his virtual cousin.  Problem is when I try to make
it use the FQDN (required by the View Client) it puts a large space between the hostname and the domain.
Result
ECHO Connecting View Client to PREFIX-SERIAL .domain.comOR"C:\Program Files\VmWare\View.exe" -Args -serverURL PREFIX-SERIAL       .domain.com
Our computers are named a combination of a prefix and the serial number.  Our virtual computer names are the same, but with a different prefix.  So my attempt was to make a connection
script, using the computer serial number.  My Process:
Setting %serial% variable.
for /F "skip=1 tokens=*" %%b in ('wmic bios get serialnumber') do if not defined serial set serial=%%b
Set %hostname% variable.
set hostname=PREFIX-%serial%
Installation command line
"C:\Program Files\VmWare\View.exe" -Args -serverURL %hostname%.domain.com
That results in the output at the beginning of my post.
I've also tried
%hostname%.%userdomain%.com
PREFIX-%serial%.%userdomain%.com
PREFIX-%serial%.domain.com
SET FQDN=.domain.com
PREFIX-%serial%%FQDN%
%hostname%%FQDN%
I also tried carets and quotes on set commands without any improvement.
I'm sure I'm missing something simple here.  Any advise?
There's no place like 127.0.0.1

Will something like this get you what you are looking for?
(gwmi win32_bios).SerialNumber+(gwmi WIN32_ComputerSystem).Domain
Or
$hostname=(gwmi win32_bios).SerialNumber+"."+(gwmi WIN32_ComputerSystem).Domain
Sorry just realized your looking to do this in a Batch file...so maybe something like this
@echo off
for /F "skip=1 delims=" %%j in ('powershell "[System.Net.Dns]::GetHostByName((hostname)).HostName"') do (
set Host=%%j
goto :DONE
:DONE
echo %HOST%

Similar Messages

  • I am using system 10.8.2 and have an issue with the screen saver not filling the screen. the desktop does, but not the screen saver. I find adjustments for the desktop, but not the saver. Would appreciate any suggestions.

    I am using system 10.8.2 and have an issue with the screen saver not filling the screen. the desktop does, but not the screen saver. I find adjustments for the desktop, but not the saver. Would appreciate any suggestions.

    I have a group of my images that rotate, and yes it happens oneach. I do believethat I have at one time had the images cover the entire screen, however I cannor remember how I made that happen, just like the desktop. I am sure it is old'ites setting in!

  • Calling batch script from Release Management for Visual Studio 2013.

    Hi All,
    I need some guidance on executing\ calling a batch script from Release Management for Visual Studio 2013 as one of the activity during release and also let me know whether the tool provides the log of this kind of execution.
    Thanks in Advance,
    Manoj

    Hi Manoj,
    To run batch script during release process when use Release Management for Visual Studio Online, you can use Command Line Runner" tool which allow user to run comtom command line. You can check in by clicking Inventory tab then tools in Release Management
    client. You can check this
    page for more information about release manage tools to deploy an app. Thanks for your understanding.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Use external drive for windows and mac

    Hello,
    I just bought a external 320Gb Western Digital Drive. I would like to use
    the drive for windows and mac.I will not like to make partation on the drive
    to use it on both operating systems. Is there any formating system with which i can use in both operating systems? I would like to use time machine feature on that drive also.
    Thanx.

    If you want to use a disk for both PC/Mac file storage and Time Machine, you will have to create two partitions. Partitioning is sort of like creating multiple virtual disks on the same physical disk. One partition should be formatted for PC (which the Mac can also use) and the other should be formatted for HFS+ (Mac only) which is what Time Machine requires. The Disk Utility application makes partitioning and formatting very easy.

  • I am using system 10.7.3 and my I photo 9.2.3 keeps crashing upon start up.  Does anyone know how to correct this without losing my photos?

    I am using system 10.7.3 and my I photo 9.2.3 keeps crashing upon start up.  Does anyone know how to correct this without losing my photos?

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Console in the page that opens.
    Step 1
    Enter the name of the crashed application or process in the Filter text field. Post the messages from the time of the last crash, if any — the text, please, not a screenshot.
    Important: Some private information, such as your name, may appear in the log. Edit it out by search-and-replace in a text editor before posting.
    Step 2
    Still in the Console window, look under User Diagnostic Reports for crash reports related to the process. The report name starts with the name of the crashed process, and ends with ".crash". Select the most recent report and post the contents — again, the text, not a screenshot. For privacy’s sake, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.) Please don’t post shutdownStall or hang logs — they're very long and not helpful.

  • Using system fonts for commercial printing?

    Hi,
    Does anyone know the licensing rights/usage for using system fonts for commercial printing? If I understand correctly, system fonts that comes from operating system CAN be use because Apple purchase the rights on them and end users that purchase OS can use these fonts freely as long as not we are not redistributing them for profit, etc.
    Can anyone point me in the right direction with official documentation on the subject?
    Thanks!

    Never mind, I found the answer. It's in Apple's OS EULA.
    "E. Fonts. Subject to the terms and conditions of this License, you may use the fonts included
    with the Apple Software to display and print content while running the Apple Software; however,
    you may only embed fonts in content if that is permitted by the embedding restrictions
    accompanying the font in question. These embedding restrictions can be found in the Font
    Book/Preview/Show Font Info panel."

  • Use one account for apps and other for itunes match

    Hello everybody
    My question today is quite simple. I use one account for apps and tv shows, but inwant to use a different itunes account for purchasing itunes match. How can I use them both on my devices? Will it be asking for my user-pass each time i play a song? What other thing should i consider?
    Thank you in advance

    I would strongly recommend you not do this.  You will regret it.
    I have played with this issue a lot.  You have to remain signed into match in order for it to show up on your phone. If you sign out to purchase an app or redownload one from your appstore id you use then match will be removed from your phone and when you go into your music app the icloud will not be there.  You then have to go sign back out of the store id you used for your app purchase and then sign back into match and everything will have to go though the download to your device process again.  This really is not what you want to do.
    Sign up to match with the apple id that you know you will use the most or has the most purchased items and use that for all purchases, i.e. books, apps, movies, and music.  You don't want to go though the other process.
    Plus apple will start not letting you sign into match because you signed out and back in, in to short a period of time.
    all store purchases on an iphone are linked to the store id.  if you sign out of your match id on the appstore and sign into another account to purchase an app then itunes match will sign out in the music app.  You can't have two store id's signed into your iphone at the same time.  They are all linked together.

  • Help! I received a message on my iPhone that "phone Number Added to iPad4 [NAME of IPAD] is now using [PHONE NUMBER] for FaceTime and iMessage" and it is not my iPad!! What do I do, how do I shut them out??

    Help! I received a message on my iPhone that "phone Number Added to iPad4 [NAME of IPAD] is now using [PHONE NUMBER] for FaceTime and iMessage" and it is not my iPad!! What do I do, how do I shut them out??

    Use a strong password and set up Two Step Verification on your account.
    http://support.apple.com/kb/ht5570

  • TS1506 I just updated my IOS to 7.1 and now I can't open Microsoft attachments - I used to always do it. Help - I use my iPad for work and now can't see any attachments.

    I just updated my IOS to 7.1 and now I can't open Microsoft attachments - I used to always do it. Help - I use my iPad for work and now can't see any attachments. I've tried opening straight into other apps and just get error messages, and I the mail preview there is just a grey screen telling me the file name and size. It worked fine until I did the IOS upgrade

    Troubleshooting apps purchased from the App Store
    http://support.apple.com/kb/TS1702
    Delete the app and redownload.
    Downloading Past Purchases from the iTunes Store, App Store and iBooks Store
    http://support.apple.com/kb/ht2519
     Cheers, Tom 

  • I recently moved and I got a new sim but I still use my old sim. I want to use both numbers for iMessage and FaceTime but i have absolutely no idea how to do it! please help me!

    I recently moved and I got a new sim but I still use my old sim. I want to use both numbers for iMessage and FaceTime but i have absolutely no idea how to do it! please help me! I have a macbook pro and iphone 5

    lewbobber wrote:
    Basically i need to either take it to a shop that can unlock i.e. £40.00
    Be aware, you go that route & every time you try to update or restore, it will error out, leaving your phone unusable. Not to mention, you void all warranty/support.
    Sell it & use the proceeds towards an officially unlocked iPhone bought directly from Apple.
    Good luck.

  • I just bought a (used) Iphone 3gs for wife and it had angry birds and $89 Navigation on it (I paid extra for it).  Once updated and logged into my I-tunes it no longer works? How can I make those apps work?

    I just bought a (used) Iphone 3gs for wife and it had angry birds and $89 Navigation on it (I paid extra for it).  Once updated and logged into my I-tunes it no longer works? How can I make those apps work?

    Apple doesn't have anything to do with this other than enforcing the DRM protection. The developers of this content expect to be paid if someone wants to use their content. When you purchase content in the app store, you purchase a license to use the content. This license does not permit you or anyone else to resell or give this content away. The individual you purchased the phone from simply does not have the right to sell or give away any purchased content on the phone. You were deceived.

  • Is anyone else having email problems such as apps exiting in the middle of an email? It may be a wireless issue. I use First Class for work and yahoo email for personal. I will be in the middle of typing a long email and the app just quits, all data lost.

    Is anyone else having email problems such as apps exiting in the middle of an email? It may be a wireless issue. I use First Class for work and yahoo email for personal. I will be in the middle of typing a long email and the app just quits, all data lost.

    Have you tried restarting or resetting your iPad?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after the iPad shuts down, then press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds). Ignore the "Slide to power off"

  • I dont know why the battery life of my iphone 4 is so low ! i really want to know how many hours i'll have if it's on standby. And how many hours if i use it normally for music and facebook (sometimes a little bit games)

    i dont know why the battery life of my iphone 4 is so low ! i really want to know how many hours i'll have if it's on standby. And how many hours if i use it normally for music and facebook (sometimes a little bit games) !!!

    to enhance your battery life, keep screen display to minimum, set screen lock automatically after 1 min, select internet notifications to off.

  • Given filename or path contains Unicode or double-byte characters.Retry using ASCII characters for filename and path What does this mean? it happen when I publish an OAM

    Given file name or path contains Unicode or double-byte characters. Retry using ASCII characters for filename and path
    What does this mean? It is happening when I try to publish an OAM for Dreamweaver.
    Also: How can I specify the browser in Edge Animate? It is just going wherever. Are there no Preferences for Edge Animate?
    BTW. Just call it Edge. Seriously. Do you call it Illustrator Draw? Photoshop Retouching?

    No, my file name is mainContent.oam
    My project name is mainContent.an
    This error happens when I try to import into Dreamweaver. Sorry, I wasn't clear on that earlier.
    I thought maybe it was because I had saved my image as a png. So re-saved as a svg, still get the error.
    DO I have a setting is Dreamweaver CC that is wrong? Should I try this in Dreamweaver CS6? I might try that next.
    Why is this program so difficult? I know Flash. I know After Effects. I can work the timeline part just great. It's always in the export that I have problems.
    On a MacPro, 10.7.
    Are you an Adobe person or just a nice helper?

  • Switched video settings on my Mac Mini and now the bloody thing shows "Invalid Format" on my TV (used as monitor for years) and I cannot get it to switch back.

    Switched video settings on my Mac Mini and now the bloody thing shows "Invalid Format" on my TV (used as monitor for years) and I cannot get it to switch back.
    What can I do to get it to work again as more than an overpriced paperweight?

    Hello,
    Safe Boot from the HD, (holding Shift key down at bootup), see if you can set a good resolution.

Maybe you are looking for

  • How to Configure Table Graphics in SAP CRM 7.0

    Dear all, What is the main use of Table Graphics and How can we configure table graphics functionality in SAP CRM 7.0. Kindly suggest in case any best practice documentation or other configuration document is available Your help will be highly apprec

  • Collection issues

    Hi, Collection P has elements A,B,C,D and another Collection Q has C,D,E,F. I want a third Collection which will contain the elements A,B,E,F. i.e. the common elements of P and Q should be removed. Can you please give code for this? Thanks Srini

  • Macmini server

    Hello all, I hope that someone with more knowledge than me can help me out on a few questions and tips. thank you already in advanced macmini is running hamachi, if anyone has a better sugestion on how to use VPN, greatly apreciated cant figure it ou

  • SCAT Transaction - Error in Application transaction S00347

    Hi Few User's are end up in getting an error message "Error in Application transaction S00347" after executing a specific Test case in SCAT Transaction. The test case gets list of product which needs an updation in a specific field in the product mas

  • I removed 1 old profile to the d'top, rel. TB, found that it doesn't work so file back to orig. loc. but TB lost e'thing all the same. I still have file. HELP

    Hi, I had 5-6 mailboxes and only wanted to delete the oldest one as I no longer need it. In hindsight this seems to have been the main one as it was the first I installed. Anyway - I thought I had found the solution to getting rid of this mail box as