Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Ok..been trying all the things I know and alot of examples from this forum, but I can't seem to "hack" it enough to get what I need.
I wrote a simple batch file with 4 commands to set time on a Win2000 server to use time from a different source/sync to that source then restart time services.
That part works, but I am doing it to allow my different sites to use the same file by running: settime.bat . I do the: settime.bat 10.127.2.1 and use the %1 in the batch file itself to pass the ipa along, and that works, but if you leave out the variable, it still runs....that is the problem I have.
I tried some If stuff like: If %1.==(). GoTo TIME, but honestly, not sure if the () means notnull or not. Any assistance or links would be most appreciated.
Thanks, Jeff

If I understand, you want to be sure your batch gets the parameter to correctly start, isn't it? If so, put this as the first line:
If not "%1"=="" GoTo TIME
Echo Missing ip address...
GoTo Exit:TIME
The () is a trick I used to test for the auto-calling of the script. It has no special meanings.
If what I posted is useful, then have a nice day, otherwise post again.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |