Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I was just interested in a post made last year - a simple batch program:
@Echo Off
ClS
Echo Hey, my name is Mike.
Pause
CD C:\MyVideo
:LOOP
Set /P Video=Enter the Video you like^>
If /I %Video%.==EXIT. GoTo :EOF
If exist %Video% GoTo :PLAY
Echo Sorry... Video not found, try again
Echo Type EXIT to quit
GoTo :LOOP:PLAY
Echo Enjoy the video!
Pause
Start MPlayer2 "%video%.mpg"
I was wondering if a have a list of videos saved in another batch file:
video1.mpg
video2.mpg
video3.mpgHow can I play the list I've made using the above batch program.
Thanks,
David

Thanks.
But what if the list (batch file) already contains the specific location of each file:
c:\dir1\vid1.mpg
c:\dir2\vid2.mpg
d:\dir3\vid3.mpg
e:\dir4\vid4.mpg
& so on up to 50 or more directory locationsWill I be able to use some sort of type command to execute a per line item for all my videos?
Thanks,
David

Hi David,
::== playlist builder
@echo off
echo c:\dir1\vid1.mpg >> some.m3u
echo c:\dir2\vid2.mpg >> some.m3u
echo d:\dir3\vid3.mpg >> some.m3u
echo e:\dir4\vid4.mpg >> some.m3u
::== and so on
M2

Thanks,thanks!
Last favor.
I managed to organized the names of the user in the network using the command "net user > list.txt". By removing the unnecessary data the list looked like this:
Administrator
guest
user1
user2
user3
user4How can i use the LSMOD command in the batch program below without having to type every user in the list.txt (it's tiresome to search & type in more than 200 users).
@Echo Off
ClS
Echo Batch Script
Pause
:LOOP
Set /P user=Enter the user name^>
If /I %user%.==exit. GoTo :EOF
If exist %user% GoTo :EXECUTE:EXECUTE
Echo User save to text!
Pause
net user "%user%" > "%user%".txt
GoTo :LOOP
Thanks,
David

Oops, sorry 'bout that. The dos program was LMOD.COM (line modification or list modification) - a dos filter (STDIN/STDOUT).
The video batch program did great. This one is another batch program (with a little similarity with the video batch program).
The netuser batch program focuses on capturing the details of each user by using the command c:\net user "username" and saving the contents in a text file
c:\net user "username" > "username".txtI'm finding a way to automatically get the name of each user in a generated list (assuming I've a list of username in a text file)to the netuser batch program without having them typed in the batch program one by one.
I did found a program called LMOD.COM that might be capable of extracting the line by line item of the user listing that I have but I'm having difficulty in integrating it with the netuser batch program.
I was wondering if an outside program like LMOD necessary or the built in command in DOS sufficient.
Thanks a lot for the help.
-David

Hi David,
I'm fuzzy, but I'm getting there.
So you have LMOD, which is a 3rd party utility, right?
I have something similar; a tiny COM util from PCMag.
As to whether it can be done using only standard XP, depends on the changes needed.
So, keeping it simple, you have a text file with:
guest
user1
user2What does the desired file look like when it's finished?
M2

Yup. The LMOD is a third party utility.
Basically the batch program will just do:
c:\net user guest > guest.txt
c:\net user user1 > user1.txt
c:\net user user2 > user2.txtAnd the sample output (contents of the guest.txt):
User name Guest
Full Name
Comment Built-in account for guest access to the computer/domain
User's comment
Country code 000 (System Default)
Account active No
Account expires NeverPassword last set 2/8/2005 5:41 PM
Password expires Never
Password changeable 2/8/2005 5:41 PM
Password required No
User may change password NoWorkstations allowed All
Logon script
User profile
Home directory
Last logon NeverLogon hours allowed All
Local Group Memberships *Guests
Global Group memberships *None
The command completed successfully.
I'm doing a batch program that have the command: net user "username" > "username".txtThe source of the "username" comes from a list.txt which have:
Administrator
Guest
User1
User2
User3
and so on.The output will depend on the number of users on the network. For my example above, I will have the following files as output:
Administrator.txt
Guest.txt
User1.txt
User2.txt
User3.txt
and so on.Hope this helps.
Thanks,
David

Hi David,
This should do it:
::==
@echo off
for /f "tokens=*" %%U in (userlist.txt) do call :userDAT %%Ugoto :eof
:userDAT
net user %1 > %1.txt
:eof
::==Note that the 2nd line starts with "for" and ends with "%%U" [no quotes] but may get wrapped by this forum interface.
M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |