Make Program Open Itself Again and Again in Batch File

I'm making a simple batch file (bat) how do I arrive stay open?

  • Thread starter superHARD
  • Starting time engagement
  • #i
and then I have a bat file that has "ipconfig /all" in it, simply when I run information technology, information technology simply closes...how do I arrive stay open? Is there a command for this or something? It needs to be fixed in the bat file, not in the Bone, I will exist sending information technology to people to tell me their MAC addresses.
Snapster
  • #2
@repeat off

ipconfig / all

break

  • #3
TY dude you rock!

now is there a way to go far auto copy to clipboard their mac address?

Snapster
  • #4
Not sure you tin do that. You could actually just output the result to a text file and get them to send that to you.

@echo off

ipconfig /all > c:\ipresult.txt

pause

  • #v
any fashion to machine put that in a email?

or any to re-create the txt file then all they take to do is paste it in a email back to me?

Snapster
  • #six
The trouble is that I don't think batch files do non have access to the clipboard. Yous tin do a mailto launch inside a batch file, only you can't prepare the body to annihilation other than a cord, only then you lot'd need to prepare that cord to the result of the control which is a tad long :)

I call up information technology's just asking a fiddling bit too much automation from a simple script, you demand a more complex scripting language or your own plan to exercise what you desire.

Then over again, batch guru'due south could well show me wrong. :)

  • #7
ok cool ty...but how do I get the mailto launch to work?

mailto launch: ?

Snapster
  • #8
Pretty much like html:

START mailto:aid@yourdomain.com?subject=Your%%20subject%%

It'll spawn a new post from the default postal service client

Ken g6

Ken g6

Programming Moderator, Elite Fellow member
December eleven, 1999
fifteen,656
2,747
55
  • #9
Hey, that start is pretty cool. :cool:

If all yous're afterwards is the MAC addresses, and not what interfaces they become to, the information could exist made shorter:

ipconfig /all | find "Physical Accost" > c:\ipresult.txt

Merely I'g not sure how to get that into the Discipline line. :(

  • #x
Cool, the notice feature workes great for me...TY!

Now, how do I automate a "run as" control in at that place?
I'grand wanting to run it as a certian username in this case the username is "install"

  • #eleven
You tin gather this information remotely using vbscript and wmi
  • #12
Originally posted by: yinan
Y'all can gather this information remotely using vbscript and wmi
I don't know how to use either of them...and I don't actually know how to apply these bat files either... :(
  • #13
Originally posted by: superHARD
Cool, the notice characteristic workes keen for me...TY!

Now, how practise I automate a "run equally" control in at that place?
I'k wanting to run it every bit a certian username in this instance the username is "install"

runas /username:yourdomain\install yourcommand

There are other options to consider, but that should exist plenty to get y'all started.

  • #14
practise y'all know their IP already?

If so, use psexec command, psexec ipconfig /all \\computernameorip /user:install

the syntax may be off (it'due south been a while since I had to bust out the pstools) merely it should exist close.

exdeath
Jan 29, 2004
13,679
10
81
  • #xv
You can do anything in a batch file that you can exercise in Windows API by calling rundll32.

For case try this from the command line:

rundll32 user32.dll LockWorkStation

  • Advertising
  • Cookies Policies
  • Privacy
  • Term & Conditions
  • Near us

vieiratherstand.blogspot.com

Source: https://forums.anandtech.com/threads/im-making-a-simple-batch-file-bat-how-do-i-make-it-stay-open.50871/

0 Response to "Make Program Open Itself Again and Again in Batch File"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel