Batch File
Moderator: Community Moderator
Batch File
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
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
- srego
- Warrant Officer
- Posts: 399
- Joined: 23 Nov 2010, 03:55
- Location: land were no gods
- Has thanked: 3 times
- Been thanked: 5 times
Re: Batch File
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
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
- LghPuppy
- GFX Team
- Posts: 40383
- Joined: 06 Jun 2011, 21:25
- Location: Watering the trees
- Has thanked: 127 times
- Been thanked: 81 times
Re: Batch File
Nice Srego.
Please consider Donating
“The only thing necessary for the triumph of evil is for good men to do nothing.”
Edmund Burke
Edmund Burke
- MrNiitriiX
- Premium Uploader
- Posts: 2197
- Joined: 19 Apr 2010, 14:52
- Location: between space and time
- Has thanked: 24 times
- Been thanked: 164 times
Re: Batch File
try theis for your first question:
also found this on the net for more details:
And to creat a loop in batch just type :a and goto a .... for example
Code: Select all
@ECHO OFF
IPCONFIG |FIND "IP"
@echo --------------------------------------------------------
@echo Domain: %USERDOMAIN%
@echo --------------------------------------------------------
@echo User: %USERNAME%
@echo --------------------------------------------------------
@echo Date: %DATE%
@echo --------------------------------------------------------
pause
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
Code: Select all
@ECHO OFF
echo My name is sagent64
:a
echo and i know you love me
goto a
Last edited by MrNiitriiX on 21 Apr 2014, 04:51, edited 1 time in total.
Re: Batch File
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
can we also let this post open so Manny people could share and learn from other skills in batch filesss
- srego
- Warrant Officer
- Posts: 399
- Joined: 23 Nov 2010, 03:55
- Location: land were no gods
- Has thanked: 3 times
- Been thanked: 5 times
Re: Batch File
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
to send a message to a computer PC1
Code: Select all
net send PC1 "hello"
Code: Select all
net send * "hello everyone"
Re: Batch File
ok ok thanks .. how about browsing files ? ... and sending files executing files using commandline to the other computer ? ... .
- srego
- Warrant Officer
- Posts: 399
- Joined: 23 Nov 2010, 03:55
- Location: land were no gods
- Has thanked: 3 times
- Been thanked: 5 times
Re: Batch File
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.
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
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 ..
also the net msg is not working maybe it will work on shell ..
- srego
- Warrant Officer
- Posts: 399
- Joined: 23 Nov 2010, 03:55
- Location: land were no gods
- Has thanked: 3 times
- Been thanked: 5 times
Re: Batch File
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
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