<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; JS: Скрипт для создания на рабочем столе RDP-подключений]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=7322</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7322&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «JS: Скрипт для создания на рабочем столе RDP-подключений».]]></description>
		<lastBuildDate>Wed, 04 Jul 2012 07:27:41 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: JS: Скрипт для создания на рабочем столе RDP-подключений]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=61366#p61366</link>
			<description><![CDATA[<p>вми тут не нужен</p>]]></description>
			<author><![CDATA[null@example.com (smaharbA)]]></author>
			<pubDate>Wed, 04 Jul 2012 07:27:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=61366#p61366</guid>
		</item>
		<item>
			<title><![CDATA[Re: JS: Скрипт для создания на рабочем столе RDP-подключений]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=61365#p61365</link>
			<description><![CDATA[<div class="quotebox"><cite>Spy00000 пишет:</cite><blockquote><div class="codebox"><pre><code>
if (resx==&quot;auto&quot;) try{ resx = wmi_item.ScreenWidth }catch(e){ resx = 1280 };
if (resy==&quot;auto&quot;) try{ resy = wmi_item.ScreenHeight }catch(e){ resy = 1024 };</code></pre></div></blockquote></div><p>Последний способ сработал. Спасибо большое!!!</p>]]></description>
			<author><![CDATA[null@example.com (DIMMon)]]></author>
			<pubDate>Wed, 04 Jul 2012 06:37:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=61365#p61365</guid>
		</item>
		<item>
			<title><![CDATA[Re: JS: Скрипт для создания на рабочем столе RDP-подключений]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=61364#p61364</link>
			<description><![CDATA[<p>Это могло помочь <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />У меня Ваш скрипт ошибку не выдаёт, поэтому полностью исправление проверить не получается.</p><p>Попробуйте тогда вот так:<br /></p><div class="codebox"><pre><code>
if (resx==&quot;auto&quot;) try{ resx = wmi_item.ScreenWidth }catch(e){ resx = 1280 };
if (resy==&quot;auto&quot;) try{ resy = wmi_item.ScreenHeight }catch(e){ resy = 1024 };</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Spy00000)]]></author>
			<pubDate>Wed, 04 Jul 2012 06:34:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=61364#p61364</guid>
		</item>
		<item>
			<title><![CDATA[Re: JS: Скрипт для создания на рабочем столе RDP-подключений]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=61363#p61363</link>
			<description><![CDATA[<div class="quotebox"><cite>Spy00000 пишет:</cite><blockquote><p>Попробуйте вот так написать:<br /></p><div class="codebox"><pre><code>if (resx==&quot;auto&quot;) resx=wmi_item.ScreenWidth || 1280;
if (resy==&quot;auto&quot;) resy=wmi_item.ScreenHeight || 1024;</code></pre></div><p>1280 и 1024 можно заменить на числа, который Вас больше устроят.</p></blockquote></div><p>А что это даст? Мне это ничего не дало. Как ругался на эти переменные так и ругается <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (DIMMon)]]></author>
			<pubDate>Wed, 04 Jul 2012 06:24:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=61363#p61363</guid>
		</item>
		<item>
			<title><![CDATA[Re: JS: Скрипт для создания на рабочем столе RDP-подключений]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=61362#p61362</link>
			<description><![CDATA[<p>Попробуйте вот так написать:<br /></p><div class="codebox"><pre><code>if (resx==&quot;auto&quot;) resx=wmi_item.ScreenWidth || 1280;
if (resy==&quot;auto&quot;) resy=wmi_item.ScreenHeight || 1024;</code></pre></div><p>1280 и 1024 можно заменить на числа, который Вас больше устроят.</p><p><strong>PS: и поменяйте заголовок Вашей темы</strong>, по правилам он должен называться так:<br />&quot;JS: Скрипт для создания на рабочем столе RDP-подключений&quot;<br />или<br />&quot;JScript: Скрипт для создания на рабочем столе RDP-подключений&quot;</p>]]></description>
			<author><![CDATA[null@example.com (Spy00000)]]></author>
			<pubDate>Wed, 04 Jul 2012 06:14:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=61362#p61362</guid>
		</item>
		<item>
			<title><![CDATA[JS: Скрипт для создания на рабочем столе RDP-подключений]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=61361#p61361</link>
			<description><![CDATA[<p>Здравствуйте, Всем! <br />Нужна помощь. Имеется скрипт, который создает на рабочем столе файлик RDP<br /></p><div class="codebox"><pre><code>
var net = new ActiveXObject(&quot;WScript.Network&quot;);
var cmpn = net.ComputerName;

if(cmpn.indexOf(&#039;-SRV&#039;) + 1)
 { var z=1}
else
{var z=0}

if (z == 0)
{

a=new ShortCutter();
a.createrdpfile(&quot;RDP Касса&quot;,true,&quot;auto&quot;,&quot;auto&quot;,&quot;192.168.0.230&quot;);


//====================
function ShortCutter()
{
this.createrdpfile=createrdpfile;
this.WshShell=WScript.CreateObject(&quot;WScript.Shell&quot;);
this.fso=new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
this.WshNetwork = WScript.CreateObject(&quot;WScript.Network&quot;);
this.user=this.WshNetwork.UserDomain + &quot;\\&quot; + this.WshNetwork.UserName;
//this.QueryWMI=QueryWMI;


function createrdpfile(name,fullscreen,resx,resy,server,user)
{
var WQL=&quot;Select ScreenHeight,ScreenWidth from Win32_DesktopMonitor where Availability=3&quot;;
var wbemFlagReturnImmediately = 0x10;
var wbemFlagForwardOnly = 0x20;
var compname, username, password;
var wmi_items;
var SWBemlocator = new ActiveXObject(&quot;WbemScripting.SWbemLocator&quot;);
var objWMIService = SWBemlocator.ConnectServer(&quot;localhost&quot;,&quot;\\root\\CIMV2&quot;,&quot;&quot;,&quot;&quot;);
var wmi_items = objWMIService.ExecQuery(WQL,&quot;WQL&quot;,wbemFlagReturnImmediately | wbemFlagForwardOnly);
var wmi_enum = new Enumerator(wmi_items);
var wmi_item = wmi_enum.item();
if (resx==&quot;auto&quot;) resx=wmi_item.ScreenWidth;
if (resy==&quot;auto&quot;) resy=wmi_item.ScreenHeight
if (user == null) u=this.user; else u=user;
if (fullscreen==true) sm=2; else sm=1;
strDesktop = this.WshShell.SpecialFolders(&quot;Desktop&quot;);
fp=strDesktop + &quot;\\&quot;+name+&quot;.rdp&quot;
//if (!this.fso.FileExists(fp)) //не создает файл, если он уже существует
{
fo = this.fso.CreateTextFile(fp,true);
s=&quot;screen mode id:i:2\n\
session bpp:i:16\n\
winposstr:s:0,0,0,0,&quot;+resx+&quot;,&quot;+resy+&quot;\n\
compression:i:1\n\
keyboardhook:i:2\n\
displayconnectionbar:i:1\n\
disable wallpaper:i:1\n\
disable full window drag:i:1\n\
allow desktop composition:i:0\n\
allow font smoothing:i:0\n\
disable menu anims:i:1\n\
disable themes:i:1\n\
disable cursor setting:i:0\n\
bitmapcachepersistenable:i:1\n\
audiomode:i:0\n\
redirectprinters:i:0\n\
redirectcomports:i:0\n\
redirectsmartcards:i:0\n\
redirectclipboard:i:1\n\
redirectposdevices:i:1\n\
redirectdrives:i:1\n\
autoreconnection enabled:i:1\n\
authentication level:i:0\n\
prompt for credentials:i:0\n\
negotiate security layer:i:1\n\
remoteapplicationmode:i:0\n\
alternate shell:s:\&quot;%PROGRAMFILES(x86)%\\1cv82\\8.2.15.289\\bin\\1cv8.exe\&quot; enterprise /s buh8-srv:1741\\SeydKassa /L RU\n\
shell working directory:s:%PROGRAMFILES(x86)%\\1cv82\\8.2.15.289\\bin\n\
gatewayhostname:s:\n\
gatewayusagemethod:i:4\n\
gatewaycredentialssource:i:4\n\
gatewayprofileusagemethod:i:0\n\
promptcredentialonce:i:1\n\
drivestoredirect:s:*\n&quot;
s=s+&quot;full address:s:&quot;+server+
&quot;\nusername:s:&quot;+u+&quot;\ndesktopwidth:i:&quot;+resx+
&quot;\ndesktopheight:i:&quot;+resy+&quot;\n&quot;+
&quot;screen mode id:i:&quot;+sm+&quot;\n&quot;;
 fo.Write(s);
 fo.Close();
}
delete wmi_enum;
delete fso;
delete SWBemlocator;
}

}
}</code></pre></div><p>Работал на УРА!! на WinXP, но с появлением Win7 возникли (правда опять не на всех компьютерах) трудности - при запуске скрипта стал ругаться на строчки <br /></p><div class="codebox"><pre><code>
if (resx==&quot;auto&quot;) resx=wmi_item.ScreenWidth;
if (resy==&quot;auto&quot;) resy=wmi_item.ScreenHeight</code></pre></div><p>а если точнее ему не нравится, что ScreenWidth и ScreenHeight равны null. Почему они вдруг равны NULL я не понял. Но вопрос не в этом, а вот в чем: можно ли чтобы при таком значении WSH не выдавал окно со страшной ошибкой, а присваивал этим переменным какое-нибудь значение? <img src="//forum.script-coding.com/img/smilies/roll.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (DIMMon)]]></author>
			<pubDate>Wed, 04 Jul 2012 05:50:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=61361#p61361</guid>
		</item>
	</channel>
</rss>
