Script with system info

Hello,
I need a simple script (powershell or anther) that write system info to a txt file with this example format:
OS = Microsoft Windows 7
CPU = Intel 434
RAM = 4
Only this 3 valors, I now the comman to obtain this info ((Get-WmiObject Win32_OperatingSystem).Name) to obtain the first valor, for example, but I don't know how to get this output format: OS = OS.
Can anyone helpme?
Thanks in advance!
jspt

I learned mostly by doing. I took my old VBScripts and converted most of them to PowerShell as a starting exercise. After that I learned by lurking here and in the
PowerShell forum.
There are some learning resources up on the site here that you can go through for getting started:
http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
There also appears to be a virtual lab that you can play around with (I haven't done this myself, so I can't vouch for its effectiveness):
http://go.microsoft.com/?linkid=9851303
You can poke around in the script repository for working examples to learn and build from:
http://gallery.technet.microsoft.com/scriptcenter
Once you've got your feet wet, try answering some questions that are posted (I'd highly recommend starting off in the PowerShell forum rather than here). I've always found that the largest obstacle to learning a new language is not having a solid goal to
attain. Answering questions here in the forums will expose you to many different problems that you may not otherwise have run into.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing)

Similar Messages

  • Running python script with system arguments from applescript

    Hi,
    I am trying to run a python code from within applescript. A string should be passed as an argument to the python script, i.e. from the terminal, I would do the following
    cd /Users/thatsme/Library/Scripts/myfolder
    python my_python_file.py abcdefg
    There are two ways I figure I could do this in applescript. "abcdefg" are contained in the variable strNote
    a) directly:
    do shell script "cd /Users/thatsme/Library/Scripts/myfolder; python my_python_file.py " & strNote
    b) calling Terminal
    tell application "Terminal"
      activate
              do script "cd /Users/claushaslauer/Library/Scripts/OO_latex; python my_python_file.py " & strNote
    end tell
    I would prefer option a) as I don't really want to have Terminal windows popping up. The strange thing is, that I see in the applescript results window the result of the print statements in the python script, but no output is generated (the python script contains a few os.system() commands.
    Option b) does what it is supposed to be doing, however, applescript does not wait until the script is finished running.
    Why does option a) nor work, and what do I need to change to make it work?

    Thank you guys for your help, this is really weird.
    Here is my full applescript
    set strNoteQ to "1+1=2"
    (* for whatever reason, this does not work *)
    do shell script "cd /Users/claushaslauer/Library/Scripts/OO_latex; python create_latex_pdf.py " & strNoteQ
    Below is my python skript.
    When I call it as
         python create_latex_pdf.py 1+1=2
    it creates a wonderful pdf.
    With the applescript above, it prints the print statements, it also generates the latex file temp.tex -- correctly, so I assume the string in this example is ok.
    However, it does not execute the latex related commands (the three os.system calls)
    Is it not a good idea / not possible to execute os.system in a python script that is called from applescript? <sorry if I had brought all the attention to the string issue>
    here is the python script:
    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    import sys
    import os
    import datetime
    import time
    def main():
        str_latex_note = sys.argv[1]
        print "%s" %  str_latex_note
        preamble = """\documentclass{article}
    \usepackage{amsmath,amssymb}
    \pagestyle{empty}
    \\begin{document}
    {\huge
    %s
    \end{document}"""% (str_latex_note)
        ## write latex file
        cur_path = r'/Users/mypath/Library/Scripts/OO_latex'
        cur_file = "temp.tex"
        fobj = open(os.path.join(cur_path, cur_file), 'w')
        fobj.writelines(preamble)
        fobj.close()
        ## process latex file
        print cur_path
        os.chdir(cur_path)
        cmd = 'latex temp.tex'
        print cmd
        print "running latex"
        os.system(cmd)
        cmd2 = 'dvips -E -f -X 1200 -Y 1200 temp.dvi > temp.ps'
        print "running dvips"
        os.system(cmd2)
        cmd3 = 'epstopdf temp.ps'
        print "running epstopdf"
        os.system(cmd3)
        print "done!"
    if __name__ == '__main__':
        main()

  • I have an external hard drive from my time capsule that stopped working on me. I am attempting to access the data with a hard drive reader on my MAC. I am able to see the drive in disk utility and under system info USB. But I am unable to access the data.

    I have an external hard drive from my time capsule that stopped working on me. I am attempting to access the data with a hard drive reader on my MAC. I am able to see the drive in disk utility and under system info USB. But I am unable to access the data and it does not show on the desktop when connected.

    Ok if disk utility was able to verify the drive I doubt there is any problem.. are you trying to open a TM backup??
    You need to mount the sparsebundle then check the actual info inside the bundle.
    Don't use disk warrior.. if the disk has verified then unless you deliberately deleted files there is nothing that is going to do.
    Pondini has a lot of stuff about getting access to the sparsebundle.
    http://pondini.org/TM/17.html
    But if you have copied info to the TC that is now gone.. and the disk is ok.. I am not sure.. the TC will not have deleted the files itself.

  • Issue is with OpenGL. System Info it allows Normal Mode but does not allow Advanced Mode.

    Problems with Repousse 3D feature in Photoshop CS5 Extended  
    I am trying to use the Repousse 3D feature in Photoshop CS5 Extended and have been unable to figure how I can get it to be an option using text. Can you explain how I do this, please?
    I have also tried rasterizing the text first and that does not work. I have tried placing the image and them loading the selection and I still do not have the option of Repousse.
    I believe the issue is with my OpenGL. In the System Info it allows Normal Mode but does not allow Advanced Mode. I spoke with the "Geek Squad" who advised that this is not an issue with my Mac but has something to do with the software.
    Can someone please help me fix this?  Thanks.

    If you really want help you may have to provide relevant information about your OS, GPU, its VRAM …

  • Execution of Coded UI scripts with least possible test execution time in Windows7 Operating system using Visual Studio Test Agent 2010 without VS2010 installed

    Hi All,
    We are trying to execute coded UI scripts without Visual Studio installed. We are using “Visual Studio Test Agent 2010” for executing coded UI scripts without VS2010 in Windows 7, it is working fine. Also we verified executing the same script with VS2010
    Premium, it works fine as well.
    Here the challenge we are facing is with the Test execution time.
    When we run the coded UI script with IE11-Windows 7 OS-Visual Studio 2010 Premium it takes
    3min 36sec to complete the execution whereas with IE11-Windows 7 OS-Visual Studio Test Agent 2010  it takes
    6min 40sec for the same script to execute (which is almost double the time it takes while executing using VS2010).
    My question is what may be the reason for this difference? and how we can reduce the test execution time when running from Test Agent 2010?
    Kindly let us know what is the best practice to execute the coded UI scripts with least test execution time in Windows 7 Operating system using Visual Studio Test Agent 2010 without VS2010
    installed.
    Looking forward for your positive response.
    Thanks in advance..!!

    Tina-Shi, Thanks for the information.
    As you mentioned, we tried to execute the coded UI test using Mstest.exe in command on VS2010 Premium and checked on the execution
    time, there was a slight difference.
    Please find below execution time.
    Using Mstest.exe in command on VS2010 Premium/Win7 – 3.47 minutes
    Using VS2010 Premium/Win7 – 3.53 minutes
    Using Test Agent/Win7 – 7.3 minutes
    Also, I closed all the other processes in Task manager before starting up the execution.
    Still , I am facing the same Issue. Could you please suggest any other way to reduce the scripting time of coded UI script execution
    through Test agent 2010.
    Looking forward for your earliest response.

  • How to get all paragraphs style and their fonts of a  indesign file and write all info with para info into txt file with scripting

    how to get all how to get all paragraphs style and their fonts of a  indesign file and write all info with para info into txt file with scriptingstyle and their fonts of a  indesign file and write all info with para info into txt file with scripting

    I write the script this one works
              var par=doc.stories.everyItem().paragraphs.everyItem().getElements();
      for(var i=par.length-1;i>=0;i--)
           var font=par[i].appliedParagraphStyle.name;
            var font1=par[i].appliedFont.name;
             var size=par[i].pointSize;
            WriteToFile (par[i].contents  +   "\r" +  "Style  : " + font  + "\r" +  "FONT1  : " + font1  + "\r" +  "Size  : " + size  + "\r", reportFilePath);
                            function WriteToFile(text, reportFilePath) { 
        file = new File(reportFilePath); 
        file.encoding = "UTF-8"; 
        if (file.exists) { 
            file.open("e"); 
            file.seek(0, 2); 
        else { 
            file.open("w"); 
          file.writeln(text);  
        file.close(); 
    Thanks for all your support

  • System info discrepancy with IPhoto

    Hi Terence,
    Two quick questions:  I either rebuilt or restored my iphoto library a couple of months ago due to inability to read and received the error:  may be in use by another application.  This occured on a 2006 macbook pro that i upgraded to lion and also iphoto 11/9.3.
    I dont remember if I rebuilt or restored (couple months gone by); however, it worked!  So no issue there.  Just wanted to give you a history as I believe it is related to my current inquiry.
    Question 1:  Further exploration shows that I have 114Gb when I do "Get Info" on the pictures folder in my home folder.  Omnidisk sweep also says I have 115Gb in pictures.However, when I lookup storage in the system information it says that I only have 70Gb in photos.  Why the discrepancy?  Did I double my library size by doing the above rebuild/restore?  Should I not worry about this as system info only shows 70Gb vs. 114Gb in pictures folder?  I also trashed the ipod photo cache (read this in previous thread from you) and saw this will be no biggie as it will be rebuilt. This got me back 14Gb, but did nothing for the above discrepancy.
    Question #2:  since I did the above, i've noticed an enormous increase in HD usage in "other" category, I do not believe this was related to the above; however, since following you and some threads I turned off time machine and therefore solved the local backup hogging up HD problem.   Since doing both things above, got at least 7Gb back-great, but believe I can still get more as I still have 45Gb of "other" in my system info.
    Are there still mobile time machine backups looming in the background or do I have some picures from restore/rebuild?  if so what is best way to delete this extra data w/out harming my photos?
    Thanks so much for your time
    waveone

    With respect, neither of these questions are about iPhoto. They're about the Finder, and what it reports
    However, when I lookup storage in the system information it says that I only have 70Gb in photos.
    Where exactly are you looking that up?

  • Gather System-info

    Hi
    I'm going to make a program that should run on all OS (Window, Solaris, Linux, HP-UX and AIX) and gather system-info like type of OS and HW-info (CPU, memory, disk etc). The program should be self-started and no requirements when it comes to if java is installed or not. I was thinking of bundle it with Java VM. I know about the System.getProperty("os.name"), but how do I gather HW-info? Do I have to make different scripts for the different OS, or can Java gather the info I need? How can I run one program that fit to all OS?
    Hope someone can help me...

    You'll have to write a JNI solution for every single OS.
    Kind regards,
      Levi

  • My apple tv is registering on my tv - i can see it on my system info screen but the apple tv doesn't show up, as well my imac doesn't seem to let me share - so i don't know whats wrong, why my apple tv isn't working

    anybody able to help me with my setup for apple tv.  i've followed the directions in the guide and my tv doesn't seem to register in part.  it's weird because my tv system info identifies the apple tv but the screen never went black and it doesn't show anything, too, my imac doesn't seem to register the apple tv unit either

    I would try connecting it to another tv to see if it works there if it does
    then likely your tv can't handle the default resolution and you should lower it on the other tv
    if not then you should connect it by usb to the computer and use itunes to restore it's firmware

  • I purchased a used 2008 iMac. And although the previous owner said he deleted all of his information his iCloud account is still the primary. I don't have a clue about what to do about it. I signed him out and logged in with my info, but still no go.

    I purchased a used 2008 iMac. And although the previous owner said he deleted all of his information, his iCloud account is still the primary. I don't have a clue about what to do about it. I signed him out and logged in with my info, but still no go. Is there any way to eliminate his iCloud account and make mine the primary without rebooting it back to factory settings? There was an update, I believe, that I couldn't install because i didn't have his password that is what made me aware that his acct. was still active. I don't know what to do. Any help is greatly appreciated. Thank you.

    Before buying a second-hand computer, you should have run Apple Diagnostics or the Apple Hardware Test, whichever is applicable.
    The first thing to do after buying the computer is to erase the internal drive and install a clean copy of OS X. You—not the original owner—must do that. Changes made by Apple over the years have made this seemingly straightforward task very complex.
    How you go about it depends on the model, and on whether you already own another Mac. If you're not sure of the model, enter the serial number on this page. Then find the model on this page to see what OS version was originally installed.
    It's unsafe, and may be unlawful, to use a computer with software installed by a previous owner.
    1. If you don't own another Mac
    a. If the machine shipped with OS X 10.4 or 10.5, you need a boxed and shrink-wrapped retail Snow Leopard (OS X 10.6) installation disc from the Apple Store or a reputable reseller—not from eBay or anything of the kind. If the machine is very old and has less than 1 GB of memory, you'll need to add more in order to install 10.6. Preferably, install as much memory as it can take, according to the technical specifications.
    b. If the machine shipped with OS X 10.6, you need the installation media that came with it: gray installation discs, or a USB flash drive for a MacBook Air. You should have received the media from the original owner, but if you didn't, order replacements from Apple. A retail disc, or the gray discs from another model, will not work.
    To start up from an optical disc or a flash drive, insert it, then restart the computer and hold down the C key at the startup chime. Release the key when you see the gray Apple logo on the screen.
    c. If the machine shipped with OS X 10.7 or later, you don't need media. It should start up in Internet Recovery mode when you hold down the key combination option-command-R at the startup chime. Release the keys when you see a spinning globe.
    d. Some 2010-2011 models shipped with OS X 10.6 and received a firmware update after 10.7 was released, enabling them to use Internet Recovery. If you have one of those models, you can't reinstall 10.6 even from the original media, and Internet Recovery will not work either without the original owner's Apple ID. In that case, contact Apple Support, or take the machine to an Apple Store or another authorized service provider to have the OS installed.
    2. If you do own another Mac
    If you already own another Mac that was upgraded in the App Store to the version of OS X that you want to install, and if the new Mac is compatible with it, then you can install it. Use Recovery Disk Assistant to prepare a USB device, then start up the new Mac from it by holding down the C key at the startup chime. Alternatively, if you have a Time Machine backup of OS X 10.7.3 or later on an external hard drive (not a Time Capsule or other network device), you can start from that by holding down the option key and selecting it from the row of icons that appears. Note that if your other Mac was never upgraded in the App Store, you can't use this method.
    3. Partition and install OS X
    a. If you see a lock screen when trying to start up from installation media or in Recovery mode, then a firmware password was set by the previous owner, or the machine was remotely locked via iCloud. You'll either have to contact the owner or take the machine to an Apple Store or another service provider to be unlocked. You may be asked for proof of ownership.
    b. Launch Disk Utility and select the icon of the internal drive—not any of the volume icons nested beneath it. In the  Partition tab, select the default options: a GUID partition table with one data volume in Mac OS Extended (Journaled) format. This operation will permanently remove all existing data on the drive.
    c. An unusual problem may arise if all the following conditions apply:
              OS X 10.7 or later was installed by the previous owner
              The startup volume was encrypted with FileVault
              You're booted in Recovery mode (that is, not from a 10.6 installation disc)
    In that case, you won't be able to unlock the volume or partition the drive without the FileVault password. Ask for guidance or see this discussion.
    d. After partitioning, quit Disk Utility and run the OS X Installer. If you're installing a version of OS X acquired from the App Store, you will need the Apple ID and password that you used. When the installation is done, the system will automatically restart into the Setup Assistant, which will prompt you to transfer the data from another Mac, its backups, or from a Windows computer. If you have any data to transfer, this is usually the best time to do it.
    e. Run Software Update and install all available system updates from Apple. To upgrade to a major version of OS X newer than 10.6, get it from the Mac App Store. Note that you can't keep an upgraded version that was installed by the original owner. He or she can't legally transfer it to you, and without the Apple ID you won't be able to update it in Software Update or reinstall, if that becomes necessary. The same goes for any App Store products that the previous owner installed—you have to repurchase them.
    4. Other issues
    a. If the original owner "accepted" the bundled iLife applications (iPhoto, iMovie, and Garage Band) in the App Store so that he or she could update them, then they're irrevocably linked to that Apple ID and you won't be able to download them without buying them. Reportedly, Mac App Store Customer Service has sometimes issued redemption codes for these apps to second owners who asked.
    b. If the previous owner didn't deauthorize the computer in the iTunes Store under his Apple ID, you wont be able to  authorize it immediately under your ID. In that case, you'll either have to wait up to 90 days or contact iTunes Support.
    c. When trying to create a new iCloud account, you might get a failure message: "Account limit reached." Apple imposes a lifetime limit of three iCloud account setups per device. Erasing the device does not reset the limit. You can still use an iCloud account that was created on another device, but you won't be able to create a new one. Contact iCloud Support for more information. The setup limit doesn't apply to Apple ID accounts used for other services, such as the iTunes and Mac App Stores, or iMessage. You can create as many of those accounts as you like.

  • Mismatch in amount of free space, between UI and System Info.

    I'm running a 2011 15" MBP, with a 2 TB drive in it, and the UI is indicating that I have about 520 some odd GB left. System Info and Drive Genius indicate about 490 some odd.
    I don't foresee this being a huge problem any time soon, but it's bugging me.

    Click here and see the note at the bottom of the page.
    (120521)

  • ECATT Script with SAPGUI Commando works in consolidation but not in prod.

    Hi experts,
    I created a eCATT script with commando SAPGUI Rec. In our consolidation system it works fine but when I try to let it run in production it is not working. User scripting is enabled (in options and in rz11). I am starting the script, the production system is getting opened but afterwards there happens nothing anymore. Also the scriptingsign in the bottom right corner is not active.
    When I am running a script with TCD Rec, it works fine in production. Is there a difference between settings for scripting for TCD Rec and SAPGUI scripting? Do you have any idea which kind of influences there could be that make this difference between TCD Rec and SAPGUI Rec scripts?
    Best regards and thank you in advance!
    Jan

    Hello,
    Ideally we should not run the ecatts in the production system as this would hamper the system environment or change systems.
    Also check in RZ11 enter sapgui/user_scripting , here the values for the last three parameters are set to TRUE.
    Thanks & Best regards,
    Ajay

  • Connecting a web script with JAVA

    Hi
    I am Trying to connect a php script from a java program. But I don't wan to implement a socket capability in the PHP script. My Main aim is to just measure how long it takes for the Entire PHP script to run. so my code might just look like this
    var1 = System.currentTimeMillis();
    connect the webserver script
    var2 = System.currentTimeMillis();
    response_time = var2 - var1;
    Is there any way i can recognise that my script(PHP) has completed executing? so that I can goto the step var2 = ..
    Basically I just want the code for "connect the webserver script". :)
    cheers
    ashay

    Open the URL directly back to the server with;-
       String host = getCodeBase().getHost().toString();
         try {
              URL url = new URL("http://"+host+"/cgi-bin/myStuff.php");
    // then
    URLConnection conn = url.openConnection();
            conn.setDoOutput(true);
            OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
            wr.write("more stuff n nonsense");
            wr.flush();
            wr.close();You don't need to open a socket + u can use printWriter dataOutputStream or whatever works best for you

  • Chinese in System Info (Russian OS X).

    I have a problem with russian language in System Info of OS X Lion (10.7.4).
    In item where i see information about RAID i see Chinese symbols!
    Can i fix it or i must to learn Chinese?)

    Try going to system preferences/language & text/language and using the Edit button to uncheck the box for Japanese and then restarting.

  • Why can't I install Firefox for Android on my Motorola Defy Mini? According to Antutu Benchmark system info, it has a ARM v7 CPU, so it should be compatible...

    When I try to install Firefox for Android on my Motorola Defy Mini (XT320), Google Play Store tells me that my device is not compatible with Firefox for Android,so I cannot install it; according to Antutu Benchmark system info, the Motorola Defy Mini has an Arm v7 CPU installed, so it should be compatible with Firefox for Android...

    Turns out it was a permissions issue, the files created by the certutil in the defaults folder got root only permissions given to them. I opened them up and it's working fine.

Maybe you are looking for

  • HT5137 Candy Crush - Lollipop Hammer - box won't go away!

    Candy Crush - bought Lollipop Hammer during a game - a box came up saying "Purchase canceled. No money was removed from your account." not true! dollar removed from my account but box wont go away! Hammers even show up on top left - game is active be

  • ITunes slow response

    After installing OSX 10.10 I have a very annoying problem with iTunes. It takes 2 seconds after pressing multimedia keys (play/pause, rewind, forward) to have response from iTunes (12.0.1). Any suggestions?

  • Calendar could not be found?

    I think I solved the problem.  I went to ical then selected calendar then selected go offline.  The pop up request error Calendar could not be found message has not showed up.  I will keep everyone informed if that should change. 

  • Regarding http to rfc

    Hi I am doing http to rfc scenario. after entering all fields in http tool it doesn't shows any response . so please tell me what are the setting to do in xi server? regards venkat

  • Signal express development tools for LV

    In SignalExpress 2.0 documentation it says that it is based on advanced Express technology which will be available to Labview users. I am looking for large number of low cost licenses for engineering stations. Love SE idea but implementation is usele