# Windows 10: Writing text files via script are corrupted

Discus and support Writing text files via script are corrupted in Windows 10 Support to solve the problem; I've just upgraded a computer from the previous Win10 to Win10 AE. I have a compiled AutoIt script which I use to read in text files from a folder and... Discussion in 'Windows 10 Support' started by rossnixon, Sep 1, 2016.

1. rossnixon Win User

## Writing text files via script are corrupted

I've just upgraded a computer from the previous Win10 to Win10 AE.
I have a compiled AutoIt script which I use to read in text files from a folder and write them out again after modifications. This has worked for years.
The files were partially corrupted today. I repeated it to check.

Moving the files and script to another computer (earlier Win10), it ran fine.

I doubt there would have been a change to how Windows reads and writes to the file system??
I'll ask in the AutoIt forum, as they may have an idea of what's happening.

:)

rossnixon, Sep 1, 2016

2. Create a PowerShell script to create a copy

Which part are you having issue with?

Writing the powershell script or calling it via a scheduled task?

Shenan Stanley, Sep 1, 2016
3. Windows Update error - status: 0x80070003, failure source: DOQ?

Hi folks,

We're investigating a case of a registry corruption that sometimes occurs on Windows 10 (1511) systems. Systems with this problem run into an error while trying to install updates. At this time the reason for the corruption
is not fully understood, but it may be the result of a third-party tool of some kind.

(If your CBS.log file shows status: 0x80070003, failure source: DOQ you might be experiencing this problem.)

We are working on a tool to try to solve this, which would enable you to update your computer. We're hoping that you can help us gather some data to refine our tool.

If your Windows 10 (1511) system is unable to take the latest updates, we'd love it if you'd run the below script to see if you are encountering this particular problem. The script doesn't change the state of your
system in any way, it just scans some log files, filters on some specific error patterns, and checks if corresponding files are present in the system's driver store.

Here's how to run the script:

1. Press Windows-R and run powershell.exe

2. Paste the below script into the Powershell window and press Enter

3. If the script indicates you have the problem, let me know!

Please note: It's okay if the script gives a red "ObjectNotFound" error, just so long as it doesn't say at the end that corruption was found.

Below is the script. As always, your help is greatly appreciated! - John Wink [MSFT]

$issuefound =$false

$files = gci$env:windir\inf\setupapi*.log

$errors =$files | Select-String "!!! *inf: *Invalid INF '.*', parsing error on line 0. Code = 1002"

$infs =$errors -Replace ".*!!! *inf: *Invalid INF '(.*)', parsing error on line 0. Code = 1002",'$1' | Sort-Object -Unique foreach ($inf in $infs) { if (-not (Test-Path$inf)) {

Write-Warning "Please contact Microsoft, corruption found in $inf"$issuefound = $true } } if (-not$issuefound) {

}

John W [MSFT], Sep 1, 2016
Thema:

1. ## Writing text files via script are corrupted - Similar Threads - Writing text files

2. ### script file

in Windows 10 BSOD Crashes and Debugging
script file: error message on boot up can not find script file c:\Users\bunny\AppData\Roaming\edit.use.vbs https://answers.microsoft.com/en-us/windows/forum/all/script-file/44f7a714-d6a5-4a6e-ae26-adcbe81d6e4b
3. ### script files

in Windows 10 BSOD Crashes and Debugging
script files: Why do I keep getting a warning box pop up every time I logon saying: can not find script file "C:\ProgramData\Lenovo-14391.vbs" and how do I get rid of it? https://answers.microsoft.com/en-us/windows/forum/all/script-files/c72ec7b0-15ca-4694-8689-ad988dbfe884
4. ### To write the script xcopy to backup the files on daily basis with file history

in Windows 10 Installation and Upgrade
To write the script xcopy to backup the files on daily basis with file history: Hi I have a folder c:\myapp\text1.txt c:\myapp\text2.txt c:\myapp\text3.txt c:\myapp\training\>training.doc When I take the backup and if there is any change in the content of the file , the existing file should be moved to the folder...
5. ### Corrupted Text?

in Windows 10 BSOD Crashes and Debugging
Corrupted Text?: Text in certain browsers (whether it be for the internet, such as Google Chrome, or in game browsers like Battlenet) are glitching out for me. I can't understand why this is happening, if it's a part for my pc or something else. Can anyone give ideas why this is happening? I...
6. ### Script file

in AntiVirus, Firewalls and System Security
Script file: I keep on receiving a Windows script file error saying cannot find script file C:\ness\miner\windows1.vbs https://answers.microsoft.com/en-us/protect/forum/all/script-file/b269b29f-db3e-4c0b-8f89-038610600d2c
7. ### USB memory corrupted and write protected

in Windows 10 Drivers and Hardware
USB memory corrupted and write protected: Hello, I have an USB memory which i used to transfer files from a laptop to another and during a transfer the laptop restarted. It became corrupted but I retrieved the files from it. When I plug it in: -it appears in the drives list, -it shows like 5gb of 8 are...
8. ### Help needed writing batch script!

in Windows 10 Support
Help needed writing batch script!: Firstly thank you for even clicking on this thread as I understand that this probably isn't meant to be here. The scenario is that I'm trying to write a script that incorporates the result of a ping to an IP and then based on the result do different things. Here is an...
9. ### Text via PC

in Windows 10 Support
Text via PC: Is it posible to send and receive text via my PC. Thanks. 73020
10. ### Can Someone Help me Write a Script

in Windows 10 Support
Can Someone Help me Write a Script: I use an old kvm switch without active ddc so I am always having to open screen resolution settings and click detect. I would like to make a script file and then a shortcut to the file to do this for me but I have never written a script and can't figure out how to do it....