TransitionalData
asked on
VBS Script to read registry data, HTTP GET/POST to intranet site
Hello,
I've developed Batch scripts to help in processing freshly imaged computers to quicken the time it takes to process them before putting them in service. Part of our corporate app creates a unique installation key that needs to be tracked per computer. My current batch script, shown below
1. Resets permissions on a registry key.
2. Ensuring time is accuate
3. outputs computername System Variables to a text file,
4. Outputs a second system variable, IMGVER, to the text file
5. reads a value from the registry (the unique key) using REG
6. Formatting the exported registry info in the text file with Munge (Less than ideal)
7. emailing the temp file with Blat.
The information that is being emailed all needs to be tracked. it's being transposed manually at the moment as it's all in a spreadsheet. An interal web application is being built for this tracking purpose.
I'm hoping someone can help with building a VBS script to help with the data collection and posting to the internal website. The URL that will be used is as follows http://server/trackcomputer.php?computername=[computername]&imageversio n=[imageve rsion]&cls id=[export ed_registr y_value]
So essentially I'm looking to replace lines 3-7 with a VB script that will format the URL and open IE and browse to that site. I know the VBS could post it blindly, but I'd like it to open IE so I can have visual confirmation that the data has hit the server.
Can someone please help? Thanks in advance.
I've developed Batch scripts to help in processing freshly imaged computers to quicken the time it takes to process them before putting them in service. Part of our corporate app creates a unique installation key that needs to be tracked per computer. My current batch script, shown below
1. Resets permissions on a registry key.
2. Ensuring time is accuate
3. outputs computername System Variables to a text file,
4. Outputs a second system variable, IMGVER, to the text file
5. reads a value from the registry (the unique key) using REG
6. Formatting the exported registry info in the text file with Munge (Less than ideal)
7. emailing the temp file with Blat.
The information that is being emailed all needs to be tracked. it's being transposed manually at the moment as it's all in a spreadsheet. An interal web application is being built for this tracking purpose.
I'm hoping someone can help with building a VBS script to help with the data collection and posting to the internal website. The URL that will be used is as follows http://server/trackcomputer.php?computername=[computername]&imageversio
So essentially I'm looking to replace lines 3-7 with a VB script that will format the URL and open IE and browse to that site. I know the VBS could post it blindly, but I'd like it to open IE so I can have visual confirmation that the data has hit the server.
Can someone please help? Thanks in advance.
subinacl.exe /verbose /subkeyreg \\%COMPUTERNAME%\HKEY_LOCAL_MACHINE\Software\PowerEcho /grant=everyone=F
net time /set /y
echo EMS Computer Name: %COMPUTERNAME% > %TEMP%\clsid.txt
echo Image Version Number: %IMGVER% >> %TEMP%\clsid.txt
REG QUERY HKEY_LOCAL_MACHINE\Software\PowerEcho /v CLSID >> %TEMP%\clsid.txt
c:\Windows\script_bin\munge.exe c:\windows\script_bin\replacements.ini -nt %TEMP%\clsid.txt
c:\windows\script_bin\blat.exe %TEMP%\clsid.txt -to sample@emailaddress.com -subject "CLSID For Imaged Laptop"
ASKER
Hi ltlbearand3,
I should have mentioned that IMGVER is an Environment Variable I've created before syspreping and imaging my machines. it gives me cmd line access to the revision number of the image. It is set on all of the Systems that will run the script on.
I'll give feedback tomorrow when I get an oppertunity to test on one of my systems. Thanks.
I should have mentioned that IMGVER is an Environment Variable I've created before syspreping and imaging my machines. it gives me cmd line access to the revision number of the image. It is set on all of the Systems that will run the script on.
I'll give feedback tomorrow when I get an oppertunity to test on one of my systems. Thanks.
ASKER
After much delay, I've had time to look again at this script. The only part that is missing is pulling the Environment Variable I've created "IMGVER" and storing that as a variable to pass along to the server. I've looked at some VBS documentation and I'm just not proficient in VBS to come up with what is necessary. can someone help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Copy and past the code into a text file and save as postinfo.vbs (or whatever you want to call it)
-Bear
Open in new window