# vbscript Does Not Run [Moved from XP]



## HarvMan (Feb 10, 2008)

Hi,

Trying to run a vbscript using this command:
c:\windows\system32\cscript.exe bwqm.vbs

The response is:
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

What am I overlooking? Thanks!


```
Const ForReading = 1
Const ForWriting = 2

Set objFSo = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\BWQMTest.txt", ForReading)

strContents = objFile.ReadAll
objFile.Close

intlength = Len(strContents)
strRemainder = Right(strContents, intLength - 4)
strNewContents = strRemainder

Set objFile = objFSO.OpenTextFile("C:\BWQMTest.txt", ForWriting)
objFile.WriteLine strNewContents

objFile.Close
```


----------



## HarvMan (Feb 10, 2008)

*Re: vbscript Does Not Run*

Just to clarify, the purpose of the script is to read a text file and remove the first 4 characters in each line.

Apparently the script is only processing the first record in the text file.

How to correct this? Thanks!


----------

