1

(Variables changed)

I used command set /p A_Aaaaaa=<aaaaaa.aaa and it says that such file doesn't exist, so I deleted @echo off from top of file, and searched for line that causes this error. I don't know why, but if I look into CMD that started script, it seem that above set /p command is understood as

set /p A_Aaaaaa= 0<aaaaaa.aaa I don't know where the (space)0 does from, any simple idea?

Ask any informations, be aware that I will change variables though.

Rik Telner
  • 179
  • 1
  • 10
  • This is one of most strange errors I ever met, because if this `set /p` commando is started manually from CMD, it works. If pasted into file... it doesn't... operate it... – Rik Telner May 22 '13 at 20:22
  • How do you start the batch file? What directory is current at that time? Is it the same directory that contains the `aaaaaa.aaa` file? Also, does the batch file change the current directory in the process? On the other hand, all those would not matter if you specified the full path to the file that the `set /p` command was reading from. – Andriy M May 25 '13 at 21:52
  • Actually problem is solved by Microsoft, but thank you for trying to help me. – Rik Telner May 26 '13 at 07:59

1 Answers1

1

0 is STDIN, the standard input stream. Usually set/p reads its input from the user (standard input). With the code set /p A_Aaaaaa=<aaaaaa.aaa you redirect the output from aaaaaa.aaa to the standard input, so set/p can read it. This behavior does not depend on whether the file exists or not. You can read something about streams here.

Community
  • 1
  • 1
Endoro
  • 37,015
  • 8
  • 50
  • 63
  • No f***, does this one, simple space, really, really matter?! – Rik Telner May 22 '13 at 20:47
  • Ehm, the link you gave, I cannot find anything useful in it... it about strange signs I am not working with (I won't work with them either I think) – Rik Telner May 22 '13 at 20:49
  • `This behavior does not depend on whether the file exists or not.` 100% it exist. Because its load from internet (VBS) and every user has one... so... A_Aaaaaa, is never empty... (only at begin but thats A LOT of lines before) – Rik Telner May 22 '13 at 20:50
  • Yes, make a file, e.g. `echo(blah>aaaaaa.aaa`. – Endoro May 22 '13 at 20:53
  • Maybe the filename being used has long filename elements and needs to be double quoted. – foxidrive May 23 '13 at 02:07
  • @Endoro Why should I? I mean, the file is really there, with real data I need to retrieve... foxidrive Length is same, its 6 characters long with 3 characters long extension. – Rik Telner May 23 '13 at 15:21
  • If the system means, there is no file then is there no file. Maybe the file name is wrong or the path. I don't know, here it works. – Endoro May 23 '13 at 16:03
  • Its really there! I typed same commands in CMD manually, this path works because I wrote echo %A_Aaaaaa% and content came out. – Rik Telner May 23 '13 at 18:05
  • No, `echo` is the command for variables, eg. `echo %path%`. for files use `type aaaaaa.aaa`. – Endoro May 23 '13 at 19:56
  • So `set /p Var= – Rik Telner May 24 '13 at 05:47
  • By the way I don't need aaaaaa.aaa for echoing, I need it to check if it matches other code inside program itself. – Rik Telner May 24 '13 at 05:48
  • read the line from file: `set /p Var= – Endoro May 24 '13 at 05:51
  • I don't want to see file, I want to compare file content to code in program itself like `if "%var1%"=="%var2%" DO SOMETHING`. It started to be offtopic. The question isn't how to read data, the problem is `set /p Var= – Rik Telner May 24 '13 at 12:32