Announcement

Collapse
No announcement yet.

environment variables in powershell

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • environment variables in powershell

    hi everyone I want to create a powershell script that will go to user profile and delete *.exe file it worked when I put it in the start up using task scheduler. but I want to deploy it using group policy startup script userpofile/roaming anybody have any idea about environment variables in powershell thanks in advance

  • #2
    Re: environment variables in powershell

    Could you post the script for us to help you with?
    In general, you use $env:username type syntax, i.e. put in the actual name of the environment variable

    http://blogs.technet.com/b/heyscript...der-paths.aspx
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: environment variables in powershell

      it's a simple script for a virus generating amcro and exe file in those locations
      remove-item c:\users\user\appdata\roaming\*.exe -force
      remove-item c:\users\user\*.exe -force
      remove-item c:\users\user\*.mac -force

      Comment

      Working...
      X