Saved Bookmarks
| 1. |
Solve : open a file? |
|
Answer» Hi all! Is this the only way? Of course not, there are always alternative ways to do anything on a PC. Consider: Code: [Select]Const ForReading = 1 Set FSO = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("c:\program files\temp.txt",ForReading) R = f.ReadAll WScript.Echo r f.close After saving the script with a vbs extension, run as cscript scriptname.vbs Is ONE better than the other? That's your choice. 8-)There are many ways. Here are a couple more using almost your exact code: Code: [Select]FOR /F "delims=" %%s in ("C:\Program Files\temp.txt") do echo %%s Code: [Select]FOR /F "tokens=*" %%s in ("C:\Program Files\temp.txt") do echo %%s |
|