Create batch file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
khorshidnam
Posts: 1
Joined: 29 Nov 2017 12:09

Create batch file

#1 Post by khorshidnam » 29 Nov 2017 12:11

Hey Pros,

I have simple question. im a newbie in batch file coding.
I want to write a script that does this:

If the value of the userdomain variable is equal to the value of the computername variable then Store into a file called output.txt the following information:

1. The current username 2. The current computername

Thanks

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Create batch file

#2 Post by Squashman » 29 Nov 2017 12:25

Code: Select all

IF /I "%userdomain%"=="%computername%" echo %username% %computername% >Output.txt

Post Reply