last day (14 days later) » 

1:07 PM
0
Q: How i can ReadAllByte with unique Volume ID in powershell?

arashzghi tried this command, it's work fine : $path= "C:\sometext.txt" [System.IO.File]::ReadAllBytes("$path") but when i tried to read all byte of file in powershell with unique ID like this code but it's doesn't work : $path = "\\.\Volume{3386ab07-0000-0000-0000-501f00000000}\sometext.txt" [Syst...

 
So what is the question? "doesn't work" is quite vague, does it throw any errors?
 
@ Mathias R. Jessen : i write error . Exception calling... and u can try it too
 
Right, but you state that it also doesn't work when you replace ? with . - what happens in that case?
 
@Mathias R. Jessen :powershell says Illegal characters in path
 
So you get the same error with both the path that starts with \\?\ and \\.\?
 
1:07 PM
nope when i use \\.\ the error is $path = "\\.\Volume{3386ab07-0000-0000-0000-501f00000000}\sometext.t‌​xt" [System.IO.File]::ReadAllBytes("$path")
 
That's not an error?
What happens exactly when you execute these two lines of code?
$path = "\\.\Volume{3386ab07-0000-0000-0000-501f00000000}\sometext.t‌​xt"
[System.IO.File]::ReadAllBytes("$path")
 
hi
tnx for give you're time to me
this error happen
Exception calling "ReadAllBytes" with "1" argument(s): "FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of
"\\.\" in the path."
At line:2 char:1
+ [System.IO.File]::ReadAllBytes("$path")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException
 
is "sometext.txt" the actual name of the file?
 
yes
it's exist
 
That's weird
 
1:14 PM
$path = "\\.\Volume{0f1f42c2-0000-0000-0000-501f00000000}\sometext.txt"
dir $path
it's work
Directory: \\.\Volume{0f1f42c2-0000-0000-0000-501f00000000}


Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 10/15/2016 1:12 AM 133 sometext.txt
 
the "FileStream will not open Win32 devices" error is usually only thrown when you use a reserved device label, such as COM, NUL or LPT
4
Q: Redirection to 'NUL' failed: FileStream will not open Win32 devices

malatI am trying to remove some verbosity from a choco install command within AppVeyor. Here is what I been trying (as suggested here): if (Test-Path "C:/ProgramData/chocolatey/bin/swig.exe") { echo "using swig from cache" } else { choco install swig > NUL } However it fails with: Redirect...

8
Q: Writing a File that has the Name of a Device

ScruffyDuckI have run into something curious. I have a decompiler that extracts information from a binary file. I am extracting a series of objects that I need to write separately to disk as binary files. These objects are graphic models compiled into a library. The objects have names embedded in them and...

 
yes it's weird
no it's simple command
but i don't know why doesn't work
:(
man tnx for you're time
 

last day (14 days later) »