Page 1 of 1
Batch File
Posted: 20 Apr 2014, 00:25
by sagent64

Hi , i want to make a script on command line that will show my IP address , Computer Name , Windows User Account , Date
is there anyone can share it here?...
or any more code can add?
i also want to know how to use Looping decrements -- like 5 4 3 2 1 in command prompt
any answer ,url w'd appreciated
Thanks
Re: Batch File
Posted: 20 Apr 2014, 01:07
by srego
I just created this for you, im using windows 8.1
to create a batch file, just open a note pad and save the file to filename.BAT
or in windows xp or 7 at command prompt just type: edit filename.BAT
just copy and paste this script:
@echo off
set ip_address="IPv4 Address"
for /f "usebackq tokens=2 delims=:" %%f in (`ipconfig ^| findstr /c:%ip_address%`) do @echo Your IP Address is: %%f
@echo Domain: %USERDOMAIN%
@echo User: %USERNAME%
@echo Date: %DATE%
@echo Time: %TIME%
set counter=5
:loop
@echo Countdown: %counter%
set /a counter=%counter%-1
if %counter% EQU 0 goto exit
goto loop
:exit
@echo here is what you asked from ChattChitto by Srego
Re: Batch File
Posted: 20 Apr 2014, 06:58
by LghPuppy
Nice Srego.
Re: Batch File
Posted: 20 Apr 2014, 08:30
by MrNiitriiX
try theis for your first question:
Code: Select all
@ECHO OFF
IPCONFIG |FIND "IP"
@echo --------------------------------------------------------
@echo Domain: %USERDOMAIN%
@echo --------------------------------------------------------
@echo User: %USERNAME%
@echo --------------------------------------------------------
@echo Date: %DATE%
@echo --------------------------------------------------------
pause
also found this on the net for more details:
Code: Select all
@echo off
echo Checking your system information, Please wating...
systeminfo | findstr /c:"Host Name"
systeminfo | findstr /c:"Domain"
systeminfo | findstr /c:"OS Name"
systeminfo | findstr /c:"OS Version"
systeminfo | findstr /c:"System Manufacturer"
systeminfo | findstr /c:"System Model"
systeminfo | findstr /c:"System type"
systeminfo | findstr /c:"Total Physical Memory"
ipconfig | findstr IPv4
echo.
echo Hard Drive Space:
wmic diskdrive get size
echo.
echo.
echo Service Tag:
wmic bios get serialnumber
echo.
echo.
echo CPU:
wmic cpu get name
echo Completed!
pause
And to creat a loop in batch just type :a and goto a .... for example
Code: Select all
@ECHO OFF
echo My name is sagent64
:a
echo and i know you love me
goto a
Re: Batch File
Posted: 15 May 2014, 16:59
by sagent64
how about sending messege to the host ? or ip address connected to your net view ? ...
can we also let this post open so Manny people could share and learn from other skills in batch filesss
Re: Batch File
Posted: 18 May 2014, 08:27
by srego
first you need to enable your net messenger services.
to send a message to a computer PC1
to send a message to the whole workgroup
Re: Batch File
Posted: 21 May 2014, 00:26
by sagent64
ok ok thanks .. how about browsing files ? ... and sending files executing files using commandline to the other computer ? ... .
Re: Batch File
Posted: 21 May 2014, 04:18
by srego
you cant browse. DOS is not a shell. but there are dos programs which is capable of browsing files.
but
you can go to the shared files of a network computer, copy, delete, rename, etc. depending on the network permission
e.g.
Code: Select all
copy 192.168.1.1\sharedfolder\test.txt D:\test
Re: Batch File
Posted: 22 May 2014, 01:13
by sagent64
ok i have shells so can you tell me how to do it in shell? or tell me the other program ? ..
also the net msg is not working maybe it will work on shell ..
Re: Batch File
Posted: 22 May 2014, 10:29
by srego
again, you need to enable the net messenger services.
ctrl panel> administrative tools> services> net messenger\
then at the dos
CMD> net start
then you can do net send.
well about shell, if you have one; its probably on its Help.
and uhmmm its been a long time that I was in the world of DOS. and I forgot the name of shell i sometime used.. its something "Norton Disk... ... " i forgot sorry
all i remember is i used two before. but I dont really rely on it. as long as you know DOS commands
its kinda hard to share all. because DOS have different versions.
if theres something you want to know, or ask.
then I maybe can do a recall and try to help
-- 22 May 2014, 17:45 --
BTW net send or the net messenger service is only available in XP
as i have said DOS commands depends on its version.
if you are running in vista win7/8
use msg.exe