Jump to content

<Solved> Problem with (@ComSpec


Borje
 Share

Recommended Posts

Hi

Is there anybody can help with @comspec syntax to have this to work

yes i know this already is possible with FileCreateShortcut command in Autoit

But I want to run it from autoit in cmd  please see below what i have try!   

Run(@ComSpec & " /c " 'shortcut.exe' "/f:%USERPROFILE%\Desktop\Notepad.lnk" "/a:c" /t:%WINDIR%\Notepad.exe", "", @SW_HIDE)

what have i done wwrong here.

This works when I paste it to cmd window..

shortcut.exe "/f:%USERPROFILE%\Desktop\Notepad.lnk" "/a:c" "/t:%WINDIR%\Notepad.exe"

IF you want to test this with  ComSpec copy shortcut.exe to windows\system32

 

Edited by Borje
Link to comment
Share on other sites

  • Developers

Just take the simple approach and take the working command and put ' /c  in front and ' at the end. ;)

Run(@ComSpec & ' /c shortcut.exe "/f:%USERPROFILE%\Desktop\Notepad.lnk" "/a:c" "/t:%WINDIR%\Notepad.exe"', "", @SW_HIDE)

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...