1

I would make this short & sweet, but I'd like to explain what/why I need help with. I have been working on a batch file that collects various information files from a system that are helpful in debugging situations. As a kernel debugger, having to ask for crash dumps, sysinfo logs, all the nine yards, over and over again, is very tiresome. With this said, I am working on a pre-existing batch file that collects such files.

I have updated it as requested by the original creator in various ways, however, their one request is one I am not sure how to go about. On Windows 8/8.1, you have the option of logging into a Microsoft account. If you use this method of logging into Windows 8, upon the completion of this batch, it will display your email address in the logs. Given this is a popular collection application among the BSOD community, the creator has received various 'complaints', all of which valid, that this is a security issue. With that said, a .vbs script has been created that essentially removes the line in the log that denotes 'Registered Owner'.

The creator wants to implement this .vbs script into the batch file in such a way that the script is created FROM the batch in %temp%, run successfully as needed, and then afterwards deleted. I do not know how to implement it this way, which is my problem. I of course successfully made a simple example \Data folder within the batch directory in which I stored the script, and then called it from the batch. However, as far as creating the script from within the batch itself within %temp% goes without having it existing locally beforehand, I have no idea.

I would very much appreciate some guidance/what to read to figure this out.

Regards,

Patrick

1
  • 1
    Is the vbs-script a fixed text or are there some variable parts? Commented Jun 11, 2014 at 5:18

1 Answer 1

1

Easier is to use batch to do it.

findstr /i /v /c:"Registered Owner" c:\windows\minidump\somelogfile.txt >c:\windows\somefilewithoutregisteredowner.txt

For help

findstr/?

To extract a vbs from bat

FOR /F "usebackq skip=6 delims=" %%i IN (%0) DO @echo %%i >>"%temp%\tmp010.vbs"
cscript "%temp%\tmp010.vbs"
del "%temp%\tmp010.vbs"
pause

goto :eof
    Set ie = CreateObject("InternetExplorer.Application") 
    ie.AddressBar = 0 
    ie.Visible = 1 
    ie.ToolBar = 0 
    ie.StatusBar = 0 
    ie.Left = 400 
    ie.Top = 100 
    ie.Width = 800 
    ie.Height = 900 
    ie.Navigate2 "http://answers.microsoft.com/en-us/windows/forum/windows_vista?tab=question&status=all"

Remember help is available on every command.

Sign up to request clarification or add additional context in comments.

3 Comments

I have edited: 'findstr /i /v /c:"Registered Owner" c:\windows\minidump\somelogfile.txt >c:\windows\somefilewithoutregisteredowner.txt' to 'findstr /i /v /%HomeDrive%"Registered Owner" %HomeDrive%\%HomePath%\Documents\SysnativeForumsFileCollectionApp\systeminfo1.txt >%HomeDrive%\%HomePath%\Documents\SysnativeForumsFileCollectionApp\systeminfo.txt' It generates a systeminfo.txt file from systeminfo1.txt, however, it goes too fast therefore no information is written to the systeminfo.txt. I tried adding: 'timeout /t 15 /nobreak >NUL' after but it does not work. Any suggestions?
It can't go too fast. In my code the /c:"Registered Owner" means /c search literally (rather than regular expressions) and : seperates the switch from the parameters, and "Registered Owner" is the term being searched for (enclosed in quotes because it contains spaces). /c:"anything" is not referring to a drive but a findstr switch.
To indicate regular expression or literal, /r and /l are used. Search string can be directly included in the command without any switch, /c is required when the term to search includes spaces. findstr "this text" ... will match any line containing this or text, but findstr /c:"this text" ... will match lines containing this text.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.