I am working on a batch script and am having trouble with the set command. I have looked in the help section of the command but am still missing something (probably simple). Here is what I have so far:
@echo off
echo Program Name: = %0
set %1 =%test%
echo Argument 1 =%1
echo Argument 2 =%2
echo Argument 3 =%3
I read this and think that Argument 1 will populate with test but I get a syntax error which is an improvement from the nothing I was getting earlier. If I can get some direction to correcting this it would be greatly appreciated. Thanks all in advance.
Set command help
Moderator: DosItHelp
-
- Posts: 319
- Joined: 12 May 2006 01:13
-
- Posts: 5
- Joined: 20 Jul 2009 17:19
-
- Posts: 319
- Joined: 12 May 2006 01:13
-
- Posts: 5
- Joined: 20 Jul 2009 17:19
I am reading the help from the cmd prompt and it says the syntax is
set variable = string. I am interpreting this as I am giving the string a value. So when I type the string portion, it returns the variable. Sorry for the poor example. I have never needed to know how to use this command before. Variables are new to me.
set variable = string. I am interpreting this as I am giving the string a value. So when I type the string portion, it returns the variable. Sorry for the poor example. I have never needed to know how to use this command before. Variables are new to me.
-
- Posts: 5
- Joined: 20 Jul 2009 17:19