WOW worked treat! Thank you.
I have only just started teaching myself but this will help me loads!
Thank you again
Search found 8 matches
- 12 Aug 2012 13:07
- Forum: DOS Batch Forum
- Topic: input variables
- Replies: 2
- Views: 2151
- 12 Aug 2012 12:47
- Forum: DOS Batch Forum
- Topic: input variables
- Replies: 2
- Views: 2151
input variables
Hi,
Just wondering if there is a way to have input from a command line to a script for when it is run
so say in the batch file there is a SET /P option=select option:
but is there a way that the variable can be set when the script is run so something like:
C:\batfile.bat 2
Just wondering if there is a way to have input from a command line to a script for when it is run
so say in the batch file there is a SET /P option=select option:
but is there a way that the variable can be set when the script is run so something like:
C:\batfile.bat 2
- 05 Aug 2012 23:37
- Forum: DOS Batch Forum
- Topic: Create a loop to set variable from text file and run batch
- Replies: 6
- Views: 6102
Re: Create a loop to set variable from text file and run bat
Hey I'm trying to do this as well
It does everything fine.
It can read the first line of a text file and use that
But im not understanding how to go to the next line after i have done what I need to.
There are sub routines, does this make a difference?
It does everything fine.
It can read the first line of a text file and use that
But im not understanding how to go to the next line after i have done what I need to.
There are sub routines, does this make a difference?
- 23 Jul 2012 14:03
- Forum: DOS Batch Forum
- Topic: Getting a files line and setting as a variable
- Replies: 10
- Views: 5211
Re: Getting a files line and setting as a variable
Well the site consists of the second and third octect and they have a number of devices connected at each site.
Each site has the same sort of setup and the fourth octet will stay the same depending on the device
Each site has the same sort of setup and the fourth octet will stay the same depending on the device
- 23 Jul 2012 13:47
- Forum: DOS Batch Forum
- Topic: Getting a files line and setting as a variable
- Replies: 10
- Views: 5211
Re: Getting a files line and setting as a variable
okay so the numbers file has site numbers say 1 - 1300 or so each on separate lines The first octet is always 10 the second octet is calculated by dividing the site number by 256 then adding 160 the third octet is calculated if the site number is bigger than 255 then minus 256 untill it is below so ...
- 23 Jul 2012 13:19
- Forum: DOS Batch Forum
- Topic: Getting a files line and setting as a variable
- Replies: 10
- Views: 5211
Re: Getting a files line and setting as a variable
Sorry, Okay so the logic of the batch file is: get a number from numbers.txt use that number and convert that into an ip address check if that ip is online if not go to start and get next number from numbers.txt if ip is online delete a file on ip address go back to start and get the next number fro...
- 23 Jul 2012 13:04
- Forum: DOS Batch Forum
- Topic: Getting a files line and setting as a variable
- Replies: 10
- Views: 5211
Re: Getting a files line and setting as a variable
Well that kind of worked
But the problem is, I have a lot of sub routines and im not able to put them in there
also it doesn't go to the next line ive now got
But the problem is, I have a lot of sub routines and im not able to put them in there
also it doesn't go to the next line ive now got
Code: Select all
for /F "skip="%line% %%i in (numbers.txt) do (
set STR=%%i
goto convert
)
- 23 Jul 2012 12:29
- Forum: DOS Batch Forum
- Topic: Getting a files line and setting as a variable
- Replies: 10
- Views: 5211
Getting a files line and setting as a variable
Hi guys, Im writing a script so that it takes a line from a file (numbers.txt) and then converts that number into an IP I've got it to convert a number from direct input but what i want to do is: Take first line of file and use a first variable Run a few commands with the variable Once command has b...