Jump to content

Start app interactively with desktop


Recommended Posts

I am attempting to start an app interactively with the desktop.  With the following code the script just runs until killed.  If I remove the top two lines it runs and finishes but obviously doesn't interact with the desktop.

$cred = (Get-Credential $env:USERNAME)
Enter-PSSession -computerName "$env:computername" -credential $cred

cd $env:userprofile\Desktop

.\Loader.bat

I would be grateful for any suggestions.
 

 

 

Link to post
Share on other sites
  • Staff

Hi Jim,

If you want to interact with the user's session, then you will need to use the PSexec to access it.

An exam:

psexec \\computer-name -u username -p password /accepteula -i 1 -d "C:\Program Files\Sublime Text 3\sublime_text.exe"

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...