Greetings all.
Need some help understanding what's happening here. I've got a simple script that will determine if a file is encrypted or not, but I'm having issues with it working in Windows XP however it works fine in Windows 7. To find out if a file is encrypted is an easy thing to find out. If you open up a CMD prompt, change to the directory with the file and type "cipher FILENAME" it will report back whether or not it's encrypted:
C:\Users\c0006767\Desktop>cipher test2.txt
Listing C:\Users\c0006767\Desktop\
New files added to this directory will be encrypted.
E test2.txt
C:\Users\c0006767\Desktop>
The "E" in front of the return data indicated it's "E"ncrypted, a "U" would indicate "U"nencrypted. This command works fine on both Windows XP and Windows 7. Cipher.exe has been part of Windows since Windows 2000. My script works great in Windows 7, however in Windows XP it's cutting off the "E test2.txt" part of the output, so the return looks like this:
Listing C:\Users\c0006767\Desktop\
New files added to this directory will be encrypted.
Again, if I open up a CMD prompt and try it that way directly, it displays what it should. I've tried different ways for the while loop, while 1 v.s. while processexists($foo), netiher seem to help Windows XP. For both operating systems, I'm an administrator. Here's the script:
Thoughts?
Need some help understanding what's happening here. I've got a simple script that will determine if a file is encrypted or not, but I'm having issues with it working in Windows XP however it works fine in Windows 7. To find out if a file is encrypted is an easy thing to find out. If you open up a CMD prompt, change to the directory with the file and type "cipher FILENAME" it will report back whether or not it's encrypted:
C:\Users\c0006767\Desktop>cipher test2.txt
Listing C:\Users\c0006767\Desktop\
New files added to this directory will be encrypted.
E test2.txt
C:\Users\c0006767\Desktop>
The "E" in front of the return data indicated it's "E"ncrypted, a "U" would indicate "U"nencrypted. This command works fine on both Windows XP and Windows 7. Cipher.exe has been part of Windows since Windows 2000. My script works great in Windows 7, however in Windows XP it's cutting off the "E test2.txt" part of the output, so the return looks like this:
Listing C:\Users\c0006767\Desktop\
New files added to this directory will be encrypted.
Again, if I open up a CMD prompt and try it that way directly, it displays what it should. I've tried different ways for the while loop, while 1 v.s. while processexists($foo), netiher seem to help Windows XP. For both operating systems, I'm an administrator. Here's the script:
#include <Constants.au3> #RequireAdmin $Foo = Run(@ComSpec & ' /c cipher.exe "test2.txt"', "c:\", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line2 $line2 = "" $Temp2 = "" While 1 $line2 &= StdoutRead($Foo) If @error Then ExitLoop WEnd While 1 $line2 &= StderrRead($Foo) If @error Then ExitLoop WEnd Sleep(3000) msgbox(0,$What,$line2,1)
Thoughts?