school assignment, any help asap is very appreciated
Moderator: DosItHelp
-
- Posts: 1
- Joined: 22 Feb 2012 19:23
school assignment, any help asap is very appreciated
Any help would be very much appreciated our instuctor has asked us to provide the following but never given any assitance nor taught the syntax or commands:
if this was python i understand the psuedo code should read something like "for x in line print hello
and so on ,
1)Write a batch file that iterates through a variable from 1 to 100 in steps of 5. For values of 1 – 50, the script should print “Hello”. For values between 51 and 100, the script should print “World.”
In as few lines as possible, write a batch file to create 20 users on your Win2k8 server using the net command
if this was python i understand the psuedo code should read something like "for x in line print hello
and so on ,
1)Write a batch file that iterates through a variable from 1 to 100 in steps of 5. For values of 1 – 50, the script should print “Hello”. For values between 51 and 100, the script should print “World.”
In as few lines as possible, write a batch file to create 20 users on your Win2k8 server using the net command
Re: school assignment, any help asap is very appreciated
Well I don't think posting twice will help you any quicker. What does your teacher get paid to do?
Open up a command prompt and type: for /?
You can do the same thing with the net command to see the syntax. Can probably do the same with Google.
Open up a command prompt and type: for /?
You can do the same thing with the net command to see the syntax. Can probably do the same with Google.
Re: school assignment, any help asap is very appreciated
Here's some further help.
Use the FOR /L command to give you the numbers, range and the step size.
and use IF a variable is less than a number then do something
IF a variable is greater than a number then do something
You will need to research the commands to put that together so you'll at least learn something.
Use the FOR /L command to give you the numbers, range and the step size.
and use IF a variable is less than a number then do something
IF a variable is greater than a number then do something
You will need to research the commands to put that together so you'll at least learn something.
Re: school assignment, any help asap is very appreciated
wwilk80260 wrote:In as few lines as possible, write a batch file to create 20 users on your Win2k8 server using the net command
This is untested
Code: Select all
@echo off
for %%a in (a b c d e f g h i j k l m n o p q r s t) do net user "%%~a"
Re: school assignment, any help asap is very appreciated
foxidrive wrote:@echo off
for %%a in (a b c d e f g h i j k l m n o p q r s t) do net user "%%~a" /add
-
- Posts: 3
- Joined: 24 Feb 2012 21:04
Re: school assignment, any help asap is very appreciated
NUMBERS:
@echo off
title YOURNAME's ASSIGNMENT NAME
set t=0
:jhji
set /a t+=1
echo Number: %t%
if %t%==50 echo Hello
if %t%==100 echo World
@ping 127.0.0.1 -n 1 -w 1 >nulc
goto jhji
-BallisticX the 12 yr old programmer
@echo off
title YOURNAME's ASSIGNMENT NAME
set t=0
:jhji
set /a t+=1
echo Number: %t%
if %t%==50 echo Hello
if %t%==100 echo World
@ping 127.0.0.1 -n 1 -w 1 >nulc
goto jhji
-BallisticX the 12 yr old programmer
-
- Posts: 3
- Joined: 24 Feb 2012 21:04
Re: school assignment, any help asap is very appreciated
typo its >nul
and dont echo Number: %t%
or u cant see echos
and dont echo Number: %t%
or u cant see echos
Re: school assignment, any help asap is very appreciated
Read the requirements more closely, BallisticX
Re: school assignment, any help asap is very appreciated
BallisticX wrote::roll: NUMBERS:
@echo off
title YOURNAME's ASSIGNMENT NAME
set t=0
:jhji
set /a t+=1
echo Number: %t%
if %t%==50 echo Hello
if %t%==100 echo World
@ping 127.0.0.1 -n 1 -w 1 >nulc
goto jhji
-BallisticX the 12 yr old programmer
There is a reason we directed him to use a FOR loop. More efficient. Nor does your solution solve either of his problems.