Home / Microsoft / Microsoft DOS / %1-12 problems
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: %1-12 problems  (Read 491 times)
mat123
Topic Starter
Hopeful



Thanked: 16
Posts: 228

Experience: Familiar
OS: Windows XP

1 1 1
« on: March 07, 2010, 06:47:52 PM »

I'm having one file start another file with check parameters to prevent the second file from being opened with out  running the first but even when i run the the first the second still comes up withe the same error message
the start command
Code: [Select]
start test2.bat %CD% %key1% 1234 %key2% 5678 %key3% 9012 %key4% 3456 i like cheese
check code
Code: [Select]
IF not "%3"=="1234" goto error1
IF not "%5"=="5678" goto error1
IF not "%7"=="9012" goto error1
IF not "%9"=="3456" goto error1
IF not "%10"=="1" goto error1
IF not "%11"=="like" goto error1
IF not "%12"=="cheese" goto error1
???
IP logged



Helpmeh
Egghead



Thanked: 117
Posts: 3,607

Experience: Experienced
OS: Windows XP


Roar.

1
« Reply #1 on: March 07, 2010, 06:53:27 PM »

In test2.bat:

test2.bat=%0
%cd%=%1
%key1%=%2
1234=%3
%key2%=%4
5678=%5
%key3%=%6
9012=%7
3456=%8
i=%9
-----
like=%10
cheese=%11

I don't know if anything below ----- can actually work.
IP logged

Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.
mat123
Topic Starter
Hopeful



Thanked: 16
Posts: 228

Experience: Familiar
OS: Windows XP

1 1 1
« Reply #2 on: March 07, 2010, 07:09:48 PM »

i guess i have to get rid of i like cheese  ::)
IP logged



Helpmeh
Egghead



Thanked: 117
Posts: 3,607

Experience: Experienced
OS: Windows XP


Roar.

1
« Reply #3 on: March 07, 2010, 07:11:19 PM »

Well, you can always see if it works.
IP logged

Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.
Salmon Trout
Sage



Thanked: 546
Posts: 7,946

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #4 on: March 08, 2010, 12:13:06 AM »

You can only use single digits for passed parameters and %0 is reserved so you just have %1 to %9 to play with. But you have the SHIFT command.
IP logged


Proud to be European
Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / %1-12 problems « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.105 seconds with 20 queries.