Accessing a file inside the same directory This topic contains 7 replies, has 2 voices, and was last updated by Tony Antony 1 year, 5 months ago. Author Posts December 13, 2016 at 6:38 pm #60124 Tony AntonyParticipant Hello, I have 2 files inside \\hqfs1\users\tantony\PowerShell\CalenderGroup\ 1 = a text file 2 = Powershell script Do I have to type in Get-Content \\hqfs1\users\tantony\PowerShell\CalenderGroup\text.txt to read the text file or can I do? Get-Content './text.txt' Thanks, December 13, 2016 at 6:49 pm #60126 RonParticipant .\text.txt You can even use tab completion to verify its there. December 13, 2016 at 6:53 pm #60129 Tony AntonyParticipant When I do that, it's pointing to system32 folder December 13, 2016 at 7:26 pm #60130 RonParticipant .\ is the current directory. Did you mean the script directory? http://stackoverflow.com/questions/3667238/how-can-i-get-the-file-system-location-of-a-powershell-script December 13, 2016 at 8:20 pm #60136 Tony AntonyParticipant I mean the current directory. In my case \\hqfs1\users\tantony\PowerShell\CalenderGroup\ That's a UNC path, so that could be the reason? December 13, 2016 at 8:24 pm #60138 RonParticipant Are you running this as a scheduled job? I've had issues with them in the past where it doesn't honor the working directory. If not, then yes, it may be a UNC path problem. If they are in the same directory, you could still use the script directory. December 13, 2016 at 8:40 pm #60144 Tony AntonyParticipant Thank you. December 13, 2016 at 8:35 pm #60139 Tony AntonyParticipant Opened in error Author Posts You must be logged in to reply to this topic.