Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NT batch script query

Status
Not open for further replies.

parsonjack

IS-IT--Management
Apr 28, 2004
29
GB
hi, i've got a simple script that prompts for a machine name and then dispays the contents of a text file on that machine as follows:-

cls
@echo off
set /p machine=Machine Name?
type \\%machine%\c$\impart\ipadman.dat
pause

this works fine on W2000 but how can i get it to work on NT?

thanks.
 
did you try:

machine.bat machinename

cls
@echo off
type \\%1\c$\impart\ipadman.dat
pause

%1 will take the argument 'machinename'
NO SPACES in machinename!

Marc [santa2]
If 'something' 'somewhere' gives 'some' error, expect random guesses or no replies at all.
Free Tip: The F1 Key does NOT destroy your PC!

Don't forget to shop @ for Christmas!
 
cheers marcs41, works fine. /p allows me to run the script from a desktop shortcut in 2000, but in NT i need to save the .bat and run it from a cmd prompt. suppose it's just another reason to look at dumping NT....ho hum.

 
there you go, you're welcome

Marc [santa2]
If 'something' 'somewhere' gives 'some' error, expect random guesses or no replies at all.
Free Tip: The F1 Key does NOT destroy your PC!

Don't forget to shop @ for Christmas!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top