RosettaCodeData/Task/Hostname/FreeBASIC/hostname.freebasic

14 lines
334 B
Plaintext

' FB 1.05.0 Win64
' On Windows 10, the command line utility HOSTNAME.EXE prints the 'hostname' to the console.
' We can execute this remotely and read from its 'stdin' stream as follows:
Dim As String hostname
Open Pipe "hostname" For Input As #1
Input #1, hostname
Close #1
Print hostname
Print
Print "Press any key to quit"
Sleep