# Trimming

**URL:** <https://forum.ansible.com/t/trimming/26662>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 5, 2018, 10:27am UTC](https://forum.ansible.com/t/trimming/26662 "2018-02-05T10:27:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![groupfiles14](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@groupfiles14](https://forum.ansible.com/u/groupfiles14)\
**Post date:** [February 5, 2018, 10:27am UTC](https://forum.ansible.com/t/trimming/26662/1 "2018-02-05T10:27:15Z")

</div>

hi,  
i have a variable registered as Location and the value is C:\Windows\System32, i want to modify it to C:\windows\felik , i would like to modify the location upto drive level wherever required… how can i do this

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [February 5, 2018, 3:04pm UTC](https://forum.ansible.com/t/trimming/26662/2 "2018-02-05T15:04:59Z")

</div>

You can probably use the win\_splitdrive filter to get the drive letter from the path

[http://docs.ansible.com/ansible/latest/playbooks\_filters.html](http://docs.ansible.com/ansible/latest/playbooks_filters.html)

You may also perhaps find using the SystemDrive and SystemRoot environment variables contain what you need.

The following powershell will return the system root, for example

`echo $env:SystemRoot`

Hope this helps,

Jon
