Createshortcut on remote machine fails

When I try to create a shortcut on the desktop of a remote machine with
the following code, the shortcut does not work.
When it is clicked on the 'Open With..' dialog appears.

Creating a shortcut while sat at the remote machine produces a shortcut
which works and which has properties which are identical to the one
produced with the code.

When sat at the remote machine, if I change the properties of the one
produced with the code and click Apply the shortcut then works.

What am I missing?

===CODE===
$mypath=<path to desktop on remote machine>
$test=(new-object -comobject "wscript.shell").createshortcut($mypath)
$test.targetpath="C:\folder"
$test.save()


-- 
Whisperer
0
Whisperer
4/12/2010 11:12:44 AM
windows.powershell 690 articles. 0 followers. Follow

3 Replies
1484 Views

Similar Articles

[PageSpeed] 37

What vaule do you have in $mypath?

I suspect that you will need to use PowerShell remoting to get this to work
-- 
Richard Siddaway
All scripts are supplied "as is" and with no warranty 
PowerShell MVP
Blog and PowerShell User Group: 
http://msmvps.com/blogs/RichardSiddaway/Default.aspx


"Whisperer" wrote:

> 
> When I try to create a shortcut on the desktop of a remote machine with
> the following code, the shortcut does not work.
> When it is clicked on the 'Open With..' dialog appears.
> 
> Creating a shortcut while sat at the remote machine produces a shortcut
> which works and which has properties which are identical to the one
> produced with the code.
> 
> When sat at the remote machine, if I change the properties of the one
> produced with the code and click Apply the shortcut then works.
> 
> What am I missing?
> 
> ===CODE===
> $mypath=<path to desktop on remote machine>
> $test=(new-object -comobject "wscript.shell").createshortcut($mypath)
> $test.targetpath="C:\folder"
> $test.save()
> 
> 
> -- 
> Whisperer
> .
> 
0
Utf
4/12/2010 3:28:01 PM
$mypath would just contain something like 
\\<machine name>\c$\documents and settings\<username>\desktop
(Yes I am an administrator)


-- 
Whisperer
0
Whisperer
4/13/2010 7:54:29 AM
====================================


-- 
Whisperer
0
Whisperer
4/14/2010 2:51:01 PM
Reply:

Similar Artilces:

"Message delivery to the remote domain '<ISP SMTP server>' failed for the following reason: The connection was dropped by the remote host."
"Message delivery to the remote domain '<ISP SMTP server>' failed for the following reason: The connection was dropped by the remote host." For the past couple of weeks I have been getting the above message every 10-15 minutes on Exchange 2000 SP3, Windows 2000 SP4. The SMTP queue also clogs up for a while then suddenly clears out. I have asked our ISP to look at their end & they claim there are no problems. A while ago I had this problem & switching off 8 bit MIME appeared to work (http://support.microsoft.com/default.aspx?kbid=262168). I have made no ...

SetCommState() fails with "A device attached to the system is not functioning"
Hello, I have successfully opened a COM port, COM6. It is actually a virtual COM port provided by a Microchip USB device. I can read/write to the device using the default parameters fine. But when I try to set the parameters with SetCommState(), the function returns FALSE, and GetLastError() is 31 which is "A device attached to the system is not functioning". Here is the DCB that SetCommState gets, nothing unusual: DCBlength: 28 BaudRate: 9600 fBinary: 1 fParity: 0 fOutxCtsFlow: 0 fOutxDsrFlow: 0 fDtrControl: 0 fDsrSensitivity: 0 fTXConti...

Stupid Question: Remote Register for Shows
I'm having a lovely time trying to update the system at work to POS. The conversion has been put off time after time due to the store being busy. As it's a small retail shop, not a surprise, but it does make it difficult to accomplish much. Latest question to come up: We have a single regular register in the store. We also have a laptop that the boss takes to shows to sell with. For shows, it's possible that the boss will be away from the home store for over two weeks. Are we going to have trouble (ie revert to eval mode) when the laptop is away from the dongle for tha...

Outlook 2003 Remote/Internet
Is it possible to have one profile for Outlook 2003 for both local and remote access to exchange? Remote meaning no VPN, but using the "Outlook over the Internet" functionality with HTTPS. If so, how? It should automatically use the same profile and credentials. What version of Exchange are you using? (Outlook Web Access is actually a component of Exchange, not Outlook - you would probably do better to ask in an Exchange group - probably Admin.) --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the SWEN virus, all mail sen...

Select Working TV Signal
Hey peeps, I've been looking for an answer to this problem for a couple weeks, done lots of google searches and searched around these forums to see if my question had already been answered.. as far as I can see it has not been. If it has, please point me to a link. thanks. PROBLEM Can not get Media Center TV Setup (win7) to see STB signal. The STB itself is a Scientific America with 1xCoaxial in, and 1xCoaxial out. *NO* RCA/COMPOSITE/HDMI. It is connected to the computer from the Coaxial out to the antenna in on my Hauppauge PVR-150 It asks me if I have a set-top box. ...

Ghosting a win98 machine
Is there any software out there that would allow me to ghost a win98 machine? ghosting? Do you mean taking a complete back-up? -- sabun, gereksiz işler şerifi. "CTC IT Mgr" <CTCITMgr@discussions.microsoft.com>, iletide şunu yazdı news:491789AA-6F45-4C73-9C55-FF7BE60B70BF@microsoft.com... > Is there any software out there that would allow me to ghost a win98 > machine? On Nov 9, 1:13 pm, "sabun" <q...@q.t> wrote: > ghosting? Do you mean taking a complete back-up? > > -- > sabun, gereksiz i=C5=9Fler =C5=9Ferifi. > &...

Installing CRM Server on AD Machine
When I try to install CRM Server on my AD Machine I am getting the following message: "Your Active Directory deployment must be in native mode." I was looking for some guidance... I am not sure where to go from here. Thank you in advance. First you need to switch to Native Mode, second forget doing it anyway for now, you can not install CRM on a DC. It will fail. Sorry fro the bad news. "Stan Guss" <anonymous@discussions.microsoft.com> wrote in message news:01e701c3c1ee$2c67c040$a501280a@phx.gbl... > When I try to install CRM Server on my AD Machine I am &...

Workflows failing after adding site bindings
We have recently added web site bindings to our CRM server to enable us to host other sites on the same machine (Sharepoint web front-end in this case). We have updated the server registry HKLM\Software\Microsoft\MSCRM \ServerUrl to reflect the new name (http://CRM/MSCRMServices) - Thanks to Michael Hoehne for that tip. The problem now is that workflows do not appear to be firing correctly. They start the "Workflow expansion task" then immediately revert to a "Waiting" status. Has anyone experienced this before and if so, what needs to be done to resolve the problem? Ma...

Entourage and remote connection
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: Exchange My company is using Exchange 2007 and the PCs are using Outlook 2007 (or 2010). <br> Outside connection from Outlook to Exchange is done using Microsoft ISA server and RPC over HTTPS (Outlook Anywhere using Exchange proxy) or OWA with RSA authentication (http://owa.server.com/exchange) <br> When connection from outside company network, does Entourage support RPC over HTTPS (like Outlook Anywhere) ? Or does it support using ExchangeWebServices through the OWA connection ? A...

User access via remote desktop
I have a situation where if I set a new user up from a local client, they only can access GP via their local client - they get a login error if trying to login via remote desktop. Likewise, if I log into the server remotely and set up a new user, they can login to GP remotely but not from their local client. Any ideas why this would occur? Thx, Frank Hamelly, MCP NOVA Solutions LLC Melbourne, FL Do you have any profiles that would be affecting where a user is using files? I've seen this issue where one user's profile was different than other users'. -- Charles Allen, MVP ...

No e-mail in remote sites sometimes, but main location is fine.
About twice a week now, all of my three remote branch city sites will fail to allow Outlook clients to communicate with the Exchange Server, but the main HQ site works fine. It can happen out of the blue, and there are no entries in the Event Viewer after it happens. My only fix is to reboot the Exchange Server. I can ping the Exchange Server by name from the affected branch store PC's, and it comes back correctly, but will not allow e-mail. Internet, databases programs, and printers all work fine during this, showing that the networking is OK just not e-mail. Exchange 2003 Server on...

Remote Access
Has anyone set up a secure access to MSCRM over the internet? Pierre H Hi: If you're talking about the Outllok client you need to set a VPN connection to your network to connect to the CRM server. For teh IE GUI all you need is a browser and a connection... John. >-----Original Message----- >Has anyone set up a secure access to MSCRM over the internet? > >Pierre H > > >. > To make it secure, you can give it a certificate and run it over HTTPS. Mike "John" <anonymous@discussions.microsoft.com> wrote in message news:31a401c3e1eb$c8a7cc30...

restriction for remote web user/remote desktop user
Is there any settings on SBS03 that allows us to manage which user/computer/ip address can connect to SBS03 network from remote site, as we would like only certain users from certain computers be able to connect on certain time remotely. If it can not be done then what would be the solution. Thank you. Jack2 wrote: >Is there any settings on SBS03 that allows us to manage which >user/computer/ip address can connect to SBS03 network from remote site, as >we >would like only certain users from certain computers be able to connect on >certain time remotely. If it ...

Comment edit, fails to exit
A comment for a cell has been edited and now will not exit. Clic outside cell, explicit edit in context menu, even closing/reopenin Excel does not help. The comment may be moved and edited as usual an hovering over the cell displays the comment in the usual fashion, bu the )(*&#%*&%# comment will not close. The file has two worksheets an this worksheet has 136 rows and 10 columns. The comment has 12 lines. The context menu for the text of the comment always displays "exit edi text" but that for the text box changes to "edit text" when "exit edi text" i...

The request failed with HTTP status 401: Unauthorized.
Hi, I want to test the CrmIncident.Retrieve method ,but i get this message : The request failed with HTTP status 401: Unauthorized. bool result = false ; // strServer should be set with the name of the platform Web server string strServer = "success"; // virtualDirectory should be set with the name of the Microsoft CRM // virtual directory on the platform Web server string virtualDirectory = "mscrmservices"; string strDir = "http://" + strServer + "/" + virtualDirectory + "/"; // BizUser proxy object Microsoft.Crm.Pl...

can only see local machine users when trying to add users allowed for remote desktop access
Hi, I have a windows 2003 server on my network(its actually a virtual machine running on windows server 2008), that I have enabled remote access to (via properties of 'My Pc/Remote') In the permission of the remote user tab, I can not find any domain users, if I try to change location it only allows me to see the local machine, and if i enter manually the domain\user name it always rejects it. I can see the entire network when I browse the network from file explorer and I can access shares on remotes machines with no problem, so I am on the network and authenticat...

Createshortcut on remote machine fails
When I try to create a shortcut on the desktop of a remote machine with the following code, the shortcut does not work. When it is clicked on the 'Open With..' dialog appears. Creating a shortcut while sat at the remote machine produces a shortcut which works and which has properties which are identical to the one produced with the code. When sat at the remote machine, if I change the properties of the one produced with the code and click Apply the shortcut then works. What am I missing? ===CODE=== $mypath=<path to desktop on remote machine> $test=(new-object...

No calculation on new machine
I run XP Home with Office 2002 I have just installed my programs to a new machine. Excel is behaving differently on the new machine: Observed so far: i) I cannot select a cell by moving with the arrow keys. ii) I can insert a calculation, SUM for instance, into a cell and I get a 0.00 result. iii) Format > Cells provides three options, Border, pattern and protection. The old machine additionally gave me number, alignment and font. What have I miised? Thanks, Robin Chapple Hi Robin, Check your status bar that you do not have SCRL on the right side to indicate Scroll Lock (there i...

The connection was dropped by the remote host. #2
All of a sudden, e-mail being sent to a domain are "delayed". I see the domain and messages in the "Queues" section of Exchange System Manager with the message of, "The connection was dropped by the remote host." I can telnet to the MX record of the domain in question. We get these message delayed messages from my exchange server but after a couple of days the message just disappear and never get to there destination. Anyone else had this issue? Thanks, William what's the email domain? if you try to send an email via that telnet session, do you ...

SP2 fails to complete
Server 2000 SP4, Exchange 2003 SP1 SP2 install fails to complete, somewhat similar to KB 919076 but without interupting mail flow. Error message from install routine: Exchange Server component Microsoft Exchange Messaging and Collaboration Services failed. Error: 0xc107041d - 0xc007041d - The service did not respond to the start or control request in a timely fashion. (EXIFS) Looking in event viewer showed that error maessage immediatly preceeded by Faulting application inetinfo.exe, version 5.0.2195.6620, stamp 3de2893b, faulting module unknown, version 0.0.0.0, stamp 00000000, debug...

Remote Desktop question
Hi all, I need to have remote access to a computer running a measuring device in the lab (basically to check whether the machine is running fine, and to interfer if I need to). Can I use a remote desktop connection for this? - I need to see the current screen with the current software running, i.e. not "switch users" and get an empty desktop - I need to be able to connect to the remote computer without user interaction (because there is nobody in the lab at night)... I considered using VNC for that, but it seems to me that a remote desktop connection would be more...

Frequent ExchSrvr restarts needed for remote users
Hello all – I have a mob of disenchanted users about to lynch me because of a problem that I cannot get to the bottom of. I recently migrated Exchange 5.5 to 2K3, consolidating three sites in the process. Now we have one Exchange Server at headquarters that hosts all mailboxes and public folders. The problem is with the users at the remote sites. Approximately every three business days, I have to restart the Exch Srvr, because over the space of a few hours, many users at the remotes sites are unable to connect to it. (“Trying to connect..” in the Outlook status bar). Only a resta...

Compacting remotely?
Hello All I have an access97 backend mdb, which I would like to compact/repair automatically overnight. Is it possible to leave a separate mdb open that would open the backend mdb, compact it, then close it again? I'm sure this can be done because I think I've read something about it somewhere: but I can't remember how - or where! Hope someone can help. Thanks Leslie Isaacs well you could schedule it with windows. take a look at Albert Kallal's solution here: http://www.members.shaw.ca/AlbertKallal/BatchJobs/Index.html change the code to compact the database... -- M...

Remote Active Sync
Hello, I just upgraded to Exchange 2003 Server and I have no idea how to setup Mobile Access. I would like to sync my pocket pc remotely. Does anyone know where I can get step by step instructions on how to do this? Thanks, Jose ...

Fail to create IXSSO.Query object
I'm moving classic asp sites from Windows 2000 / IIS 5 to Windows 2008 R2 / IIS 7. * We have the "Indexing Service" started. * I have forced IIS to run application pool in 32 bit mode. * IXSSO.DLL is present in System32 directory. (dated 7/13/2009 it is from W2k8, I assume it is 64 bits) * Catalogs were created and looked OK. However, I am unable to create an ixsso.Query object. Get the following error message : Microsoft VBScript runtime error '800a01ad' ActiveX component can't create object /HC/ECO/Announcements/Headlines/SearchResul...