ricky Posted February 19, 2014 Posted February 19, 2014 Hello, who can translate a script from vbs to autoit? The script below, Pin.vbs : Set objShell = CreateObject("Shell.Application") Set filesystem = CreateObject("scripting.Filesystemobject") If filesystem.FileExists(Wscript.Arguments(0)) Then Set objFolder = objShell.Namespace(filesystem.GetParentFolderName(Wscript.Arguments(0))) Set objFolderItem = objFolder.ParseName(filesystem.GetFileName(WScript.Arguments(0))) Set colVerbs = objFolderItem.Verbs Select case WScript.Arguments(1) case 0 For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Unpin from Taskbar" Then objVerb.DoIt Next case 1 For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then objVerb.DoIt Next case 2 For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Install" Then objVerb.DoIt Next End Select End If MyExplorerLnk.vbs : Set WshShell = WScript.CreateObject("WScript.Shell" ) ' Shortcut Name (Special Folders) ' strLocation = WshShell.SpecialFolders("AllUsersDesktop" ) ' Set oShellLink = WshShell.CreateShortcut(strLocation & "\Windows Explorer.lnk" ) ' Shortcut Name (Environment Variables) strLocation = WshShell.ExpandEnvironmentStrings("%APPDATA%" ) set oShellLink = WshShell.CreateShortcut(strLocation & "\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Windows Explorer.lnk" ) ' Shortcut Name (Normal Path) ' Set oShellLink = WshShell.CreateShortcut("C:\Windows Explorer.lnk" ) ' Path to application oShellLink.TargetPath = "%Windir%\explorer.exe" ' Command line arguments oShellLink.Arguments = " shell:MyComputerFolder" ' Window Style oShellLink.WindowStyle = 1 ' Hotkey oShellLink.Hotkey = "" ' Icon for Shortcut oShellLink.IconLocation = "%windir%\explorer.exe" ' Shortcut Comment oShellLink.Description = "Windows Explorer" ' Working Directory oShellLink.WorkingDirectory = "" oShellLink.Save Thanks in advance
FireFox Posted February 19, 2014 Posted February 19, 2014 Hi, It's really simple, take a look at the forum you will have plenty of examples. Br, FireFox.
Moderators JLogan3o13 Posted February 19, 2014 Moderators Posted February 19, 2014 Hello, who can translate a script from vbs to autoit? With a little effort, YOU CAN AutoIt and VBS are very close in syntax. As a suggestion, start with cracking the help file and looking at ObjCreate (the equivalent of CreateObject). From there, it should be pretty easy. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
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