An url can not contain spaces, they have to be encoded. The %20 code is
the encoded form of a space, so that is perfectly correct.
So the problem is not the space in the url.
What do you mean when you say that the link "does not work"? What
happens? Do you get an error message?
Where is the file located? Do you have access to the s: drive from the
client computer?
wrote:
> Ok , developing a .aspx page with Visual Web Studio (the full page is
> at the bottom). Basically its a page that displays all my computers
> and the current logged on user pulling data from a live Altiris
> database.
>
> This works fine, i have added a feature with a link for me to click to
> run radmin against that computer so i can remote control it.
>
> The link shows properly when I hover over it
> "S:\apps\!drivers\WindowsETC\rview.bat PCNAME". However if i click the
> link it does not work, if i copy the link and paste it into notepad it
> shows up as
>
> s:\apps\!drivers\WindowsETC\rview.bat%20PCNAME
>
> Somehow i need to get a true space into this link and not have the aspx
> process it. The line in question is line # 17, HyperLink1.NavigateUrl
> = "S:\apps\!drivers\WindowsETC\rview.bat " & PCName
>
> What am i doing wrong ?
>
> Here is the entire file :
>
> <%@ Page Language="VB" debug="true"%>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> <script runat="server">
>
> Sub RowCommand(ByVal sender As Object, ByVal e As
> GridViewCommandEventArgs)
> Message.Text = e.CommandName & ", " &
> e.CommandSource.ToString & ", " & e.CommandArgument
> Dim Grid As GridView
> Dim PCName As String
> Grid = sender
> PCName = Grid.Rows.Item(e.CommandArgument).Cells(1).Text
> Message.Text = PCName
> ' HyperLink1.NavigateUrl = "C:\Program
> Files\RAdmin\Radmin.exe /connect:" & PCName
> HyperLink1.NavigateUrl =
> "S:\apps\!drivers\WindowsETC\rview.bat" & PCName
> 'Chr(34) = "
> 'Chr(32) = space
>
>
> End Sub
>
>
> </script>
>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> <asp:TextBox ID="Message" runat="server"
> Width="419px"></asp:TextBox><br />
> <asp:HyperLink ID="HyperLink1" runat="server"
> Width="423px">HyperLink</asp:HyperLink><br />
> <asp:GridView ID="GridView1" runat="server" AllowSorting="True"
> AutoGenerateColumns="False"
> DataSourceID="SqlDataSource1" OnRowCommand="RowCommand">
> <Columns>
> <asp:ButtonField
> DataTextField="PCName"
> HeaderText="Link to RAdmin"
> CommandName=DataTextField
> InsertVisible="False" />
> <asp:BoundField DataField="PCName"
> HeaderText="PCName" SortExpression="PCName" />
> <asp:BoundField DataField="LoggedOnUser"
> HeaderText="LoggedOnUser" ReadOnly="True"
> SortExpression="LoggedOnUser" />
> <asp:BoundField DataField="Serial" HeaderText="Serial"
> SortExpression="Serial" />
> <asp:BoundField DataField="Model" HeaderText="Model"
> SortExpression="Model" />
> <asp:BoundField DataField="FreeDiskSpace"
> HeaderText="FreeDiskSpace" SortExpression="FreeDiskSpace" />
> <asp:BoundField DataField="ram_total"
> HeaderText="ram_total" SortExpression="ram_total" />
> </Columns>
> </asp:GridView>
> <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ConnectionString="<%$ ConnectionStrings:eXpressConnectionString %>"
> SelectCommand="SELECT [PCName], [LoggedOnUser], [Serial],
> [Model], [FreeDiskSpace], [ram_total] FROM [vw_Randy_PC_List] Order By
> [LoggedOnUser]">
> </asp:SqlDataSource>
> </div>
> </form>
> </body>
> </html>
>