![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | VBS script question I have a VBS script and it looks for a file in local drive: LocFolder = "C:\myfiles" It works fine. I am trying to make adjustments so it can also read from a mapped drive. Any hints. thanks |
My System Specs![]() |
| | #2 (permalink) |
| | Re: VB script question "rogv" <rvaedex23@xxxxxx> wrote in message news:c31ecefe-2708-4205-a179-565e2b109afd@xxxxxx Quote: >I have a VBS script and it looks for a file in local drive: > > LocFolder = "C:\myfiles" > > It works fine. > > I am trying to make adjustments so it can also read from a mapped > drive. > Any hints. thanks LocFolder = "\\RemotePC\ShareName\FolderName" |
My System Specs![]() |
| | #3 (permalink) |
| | Re: VB script question On Oct 20, 4:15*pm, "Pegasus \(MVP\)" <I....@xxxxxx> wrote: Quote: > "rogv" <rvaede...@xxxxxx> wrote in message > > news:c31ecefe-2708-4205-a179-565e2b109afd@xxxxxx > Quote: > >I have a VBS script and it looks for a file in local drive: Quote: > > LocFolder = "C:\myfiles" Quote: > > It works fine. Quote: > > I am trying to make adjustments so it can also read from a mapped > > drive. > > Any hints. *thanks > Have you tried UNC coding? > LocFolder = "\\RemotePC\ShareName\FolderName" |
My System Specs![]() |
| | #4 (permalink) |
| | Re: VB script question "rogv" <rvaedex23@xxxxxx> wrote in message news:d95a8d04-98ef-43c2-b5be-4ab68149fd86@xxxxxx On Oct 20, 4:15 pm, "Pegasus \(MVP\)" <I....@xxxxxx> wrote: Quote: > "rogv" <rvaede...@xxxxxx> wrote in message > > news:c31ecefe-2708-4205-a179-565e2b109afd@xxxxxx > Quote: > >I have a VBS script and it looks for a file in local drive: Quote: > > LocFolder = "C:\myfiles" Quote: > > It works fine. Quote: > > I am trying to make adjustments so it can also read from a mapped > > drive. > > Any hints. thanks > Have you tried UNC coding? > LocFolder = "\\RemotePC\ShareName\FolderName" ================= This means that you have a permission issue or a error in the name. Try this humble command from a Command Prompt: dir "\\RemotePC\ShareName\FolderName" If this works and your script does not work then you should post your script. |
My System Specs![]() |
| | #5 (permalink) |
| | Re: VB script question On Oct 20, 5:40*pm, "Pegasus \(MVP\)" <I....@xxxxxx> wrote: Quote: > "rogv" <rvaede...@xxxxxx> wrote in message > > news:d95a8d04-98ef-43c2-b5be-4ab68149fd86@xxxxxx > On Oct 20, 4:15 pm, "Pegasus \(MVP\)" <I....@xxxxxx> wrote: > > > > > Quote: > > "rogv" <rvaede...@xxxxxx> wrote in message Quote: > >news:c31ecefe-2708-4205-a179-565e2b109afd@xxxxxx Quote: Quote: > > >I have a VBS script and it looks for a file in local drive: Quote: Quote: > > > LocFolder = "C:\myfiles" Quote: Quote: > > > It works fine. Quote: Quote: > > > I am trying to make adjustments so it can also read from a mapped > > > drive. > > > Any hints. thanks Quote: > > Have you tried UNC coding? > > LocFolder = "\\RemotePC\ShareName\FolderName" > Yes, It says it cannot find path. *For local folders it works OK. > > ================= > > This means that you have a permission issue or a error in the name. Try this > humble command from a Command Prompt: > dir "\\RemotePC\ShareName\FolderName" > > If this works and your script does not work then you should post your > script.- Hide quoted text - > > - Show quoted text - |
My System Specs![]() |
| | #6 (permalink) |
| | Re: VBS script question If the drive is mapped then it can be treated as a local drive. You shouldn't have to modify the code at all. I agree that it may be a permission problem. If you are at a command prompt, can you "type" the file? For example, let's assume that the mapped drive is "Z:" and the file you are trying to read is z:\myfolder\myfile.txt Let us also assume that you are currently at the root of the C drive. What happens when you do the following" C:\>type z:\myfolder\myfile.txt If you can list the file from the command prompt then your script should work as well (but because I haven't seen your script I will reserve judgement). What error do you get when you try to read from the mapped drive? |
My System Specs![]() |
| | #7 (permalink) |
| | Re: VBS script question Don't forget that you need to escape spaces, colons and back slashes. All I have handy is this unescape VBA method - but you get the idea ... Function unescape(s As String) As String s = Application.Substitute(s, "%20", " ") s = Application.Substitute(s, "%3A", ":") s = Application.Substitute(s, "%5C", "\") unescape = s End Function Incidentally VBScript has an escape function built in. WScript I haven't checked. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| question on: HTA and format to include external script file | VB Script | |||
| vbs script question | VB Script | |||
| Question - flushing out powershell.exe when existing a script | PowerShell | |||
| Newbie question - Is there a script/command to do a backup of a di | PowerShell | |||
| Newbie Question: Here-Script with PowerShell | PowerShell | |||