Jump to content

command prompt variables set from a .txt?


Snacks

Recommended Posts

Well, for started DOS commands can be no longer than 256 bytes, and I do believe that that is post variable-substitution. So basically, you can't use a variable with more than 253 bytes of content. As you're in control of the file, can't you just put a 'SET VARIABLE=' at the beginning, and then run the file?

Alternatively, install the BASH shell on Windows. That's actually a good idea regardless.

Link to comment
Share on other sites

I had this small script somewhere, and I think it might help you.. it's a kinda lame netbios bruteforcer, but what it does is it reads the user/passes from netbios.txt, and then interprets them as variables, which I think is what you want.

FOR /F "token=1,2*" %i in (netbios.txt)

DO net use 127.0.0.1IPC$ %i /u: %j

Link to comment
Share on other sites

As you're in control of the file, can't you just put a 'SET VARIABLE=' at the beginning, and then run the file?

Well my problem is that I want to hand out discs for attendees of a LAN party, each disc will have the batch and an IP address, this is to ease the stress of everyone asking "what IP am I?", "how do i set up my TCP/IP" etc. I guess I'm just going to have to make an individual .bat for every attendee.

Link to comment
Share on other sites

Well my problem is that I want to hand out discs for attendees of a LAN party, each disc will have the batch and an IP address, this is to ease the stress of everyone asking "what IP am I?", "how do i set up my TCP/IP" etc. I guess I'm just going to have to make an individual .bat for every attendee.

Set up a domain controller. Make attendees log on to the domain controller, and have it run a boot script on the client that spits out this particular info.

One popular method that admins at my work tend to do is to generate a desktop background that faintly contains the IP address and machine name so that after a few too many desktop switches it can be easily deduced what machine you're working on.

On a lan-party that might be pushing it, so you could just push a .txt file onto the client desktop that has all the relevant information. You know, their IP, server IPs, ports, etc.

Will save you the troubles of distribution too.

When they forget their info and removed the file, don't help them but tell them to re-logon to the domain and not remove the .txt file next time. That will teach them really quick that it is to be kept around for the duration of the party.

Link to comment
Share on other sites

I'm a UNIX guy, so I have no actual experience with all this stuff aside from the simple fact that I know it can be done since they're doing it were I work, and used it at the bank where I was stationed before.

Maybe someone else can fill in the blanks. I'm pretty sure going with any Windows Server OS will prove easiest to set up. As long as the crowd is friendly you shouldn't have much qualms about that one.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...