<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — Help with a Script]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=5647</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=5647&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Help with a Script.]]></description>
		<lastBuildDate>Fri, 11 Oct 2019 17:04:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Help with a Script]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=33060#p33060</link>
			<description><![CDATA[<div class="quotebox"><cite>DriveSoft wrote:</cite><blockquote><p>Unfortunately I don&#039;t know how to map a network drive, but try this:</p><div class="codebox"><pre><code>OpenFile(&#039;use U: \\DC-1\UsersHome$\&quot;&#039;+User+&#039;&quot; /u:,&quot;&#039;+User+&#039;&quot; &quot;Pass&quot;&#039;, &#039;net&#039;);</code></pre></div></blockquote></div><p>Thank you, I tried it that way too and still couldn&#039;t map the drive.&nbsp; Finally what I did was kind of a crazy detour and probably more work<br />than needed to make it work but it&#039;s working for me without any problems.&nbsp; Here&#039;s the code:</p><div class="codebox"><pre><code>var
ini:TIniFile;


procedure Form1_edUser_OnChange (Sender: TObject);
begin
  ini:=TIniFile.Create(ExtractFilePath (ParamStr (0))+&#039;info.ini&#039;);
  ini.WriteString(&#039;INFO&#039;,&#039;USER&#039;,Form1.edUser.Text);
end;
procedure Form1_edPass_OnChange (Sender: TObject);
begin
  ini:=TIniFile.Create(ExtractFilePath (ParamStr (0))+&#039;info.ini&#039;);
  ini.WriteString(&#039;INFO&#039;,&#039;PASS&#039;,Form1.edPass.Text);
end;


procedure Form1_OnShow (Sender: TObject; Action: string);
begin
    Form1.edUser.SetFocus;
end;

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin

       OpenFile(&#039;connect.cmd.lnk&#039;);
       application.processmessages;
       sleep(600);
       Form1.edStatus.Visible := TRUE;

end;</code></pre></div><p>I&#039;m creating a .INI file, saving the information from the user&#039;s input in the form to this INI file, then having a batch file read the contents of<br />the INI file and executing the mapping.</p>]]></description>
			<author><![CDATA[null@example.com (gonpublic2k)]]></author>
			<pubDate>Fri, 11 Oct 2019 17:04:51 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=33060#p33060</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help with a Script]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=33033#p33033</link>
			<description><![CDATA[<p>Unfortunately I don&#039;t know how to map a network drive, but try this:</p><div class="codebox"><pre><code>OpenFile(&#039;use U: \\DC-1\UsersHome$\&quot;&#039;+User+&#039;&quot; /u:,&quot;&#039;+User+&#039;&quot; &quot;Pass&quot;&#039;, &#039;net&#039;);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DriveSoft)]]></author>
			<pubDate>Fri, 11 Oct 2019 10:39:10 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=33033#p33033</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help with a Script]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=33014#p33014</link>
			<description><![CDATA[<div class="quotebox"><cite>DriveSoft wrote:</cite><blockquote><div class="codebox"><pre><code>OpenFile(&#039;net use U: \\DC-1\UsersHome$\&quot;&#039;+User+&#039;&quot; /u:,&quot;&#039;+User+&#039;&quot; &quot;Pass&quot; net.exe&#039;);</code></pre></div></blockquote></div><p>Hi Dmitry,</p><br /><p>thanks for the quick answer,&nbsp; unfortunately that still didn&#039;t work&nbsp; <img src="https://myvisualdatabase.com/forum/img/smilies/sad.png" width="15" height="15" alt="sad" /></p><p>It&#039;s not mapping the network drive.</p>]]></description>
			<author><![CDATA[null@example.com (gonpublic2k)]]></author>
			<pubDate>Thu, 10 Oct 2019 14:38:14 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=33014#p33014</guid>
		</item>
		<item>
			<title><![CDATA[Re: Help with a Script]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=33013#p33013</link>
			<description><![CDATA[<div class="codebox"><pre><code>OpenFile(&#039;net use U: \\DC-1\UsersHome$\&quot;&#039;+User+&#039;&quot; /u:,&quot;&#039;+User+&#039;&quot; &quot;Pass&quot; net.exe&#039;);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DriveSoft)]]></author>
			<pubDate>Thu, 10 Oct 2019 14:19:10 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=33013#p33013</guid>
		</item>
		<item>
			<title><![CDATA[Help with a Script]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=33012#p33012</link>
			<description><![CDATA[<p>Hi All,</p><p>I need help with the following action for a button.&nbsp; When click I want to map a network drive using parameters from user&#039;s input boxes, the following code doesn&#039;t give me any error but does not map the drive <img src="https://myvisualdatabase.com/forum/img/smilies/sad.png" width="15" height="15" alt="sad" />&nbsp; &nbsp; &nbsp;</p><p>thanks in advance!</p><div class="codebox"><pre><code>procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
User: string;
Pass: string;
begin
    User := Form1.edUser.Text;
    Pass := Form1.edPass.Text;

    OpenFile(&#039;net use U: \\DC-1\UsersHome$\&quot;User&quot; /u:,&quot;User&quot; &quot;Pass&quot; net.exe&#039;);
end;


begin
 Form1.mniFile.Visible := False;
 Form1.mniOptions.Visible := False;
 Form1.mniSettings.Visible := False;
 Form1.mniReport.Visible := False;
 Form1.mniAbout.Visible := False;
end.</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (gonpublic2k)]]></author>
			<pubDate>Thu, 10 Oct 2019 14:03:10 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=33012#p33012</guid>
		</item>
	</channel>
</rss>
