Borje Posted September 23, 2020 Posted September 23, 2020 (edited) 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 September 23, 2020 by Borje
Developers Jos Posted September 23, 2020 Developers Posted September 23, 2020 (edited) 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 September 23, 2020 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.
Borje Posted September 23, 2020 Author Posted September 23, 2020 Hi Jos When I run this a got error parsing function call.
Borje Posted September 23, 2020 Author Posted September 23, 2020 Jos Thank you so much That works perfect I am sorry that was here i have problem but your example works.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now