ajdbnabad13
ajdbnabad13

Reputation: 385

Implement a .vbs in a batch without it being stored locally

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

Upvotes: 1

Views: 117

Answers (1)

phd443322
phd443322

Reputation: 503

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.

Upvotes: 1

Related Questions