vbscript

Copy a file from one folder to another using vbscripting

大憨熊 提交于 2021-02-04 10:19:05
问题 Can anyone please tell me how to copy a file from one folder to another using vbscripting I had tried this below one from the information provide in the internet. dim filesys set filesys=CreateObject("Scripting.FileSystemObject") If filesys.FileExists("c:\sourcefolder\anyfile.txt") Then filesys.CopyFile "c:\sourcefolder\anyfile.txt", "c:\destfolder\" When I execute this one, I get that the permission is denied. 回答1: Try this. It will check to see if the file already exists in the destination

Batch function not working correctly

萝らか妹 提交于 2021-01-29 21:00:34
问题 A while ago I made a function that you can call from the command prompt or any batch file (it was just for fun, I don't see how it could be useful). It basically just makes your (Microsoft) computer speak whatever you wrote in as the parameter. I recently got some inspiration to add a switch to it where it would read the contents of a file. My standalone script worked, but when I added it to my function, it didn't work as I would have liked. Here's the code: @echo off & setlocal

Download and Execute with VBS

穿精又带淫゛_ 提交于 2021-01-29 18:39:48
问题 I am trying to write a simple VBS script to download and execute a file. From wireshark I can verify that the file is being retrieved form the webserver, but it is not getting executed upon download. I am getting a "Invalid Character" on the "Execute" line. What am I doing wrong? Set x=CreateObject("Microsoft.XMLHTTP") x.Open "GET","http://website/file.exe",False x.Send Execute x.responseText I would also like to remove the "If-Modified-Since" header from the GET request. 回答1: You aren't

Batch function not working correctly

此生再无相见时 提交于 2021-01-29 18:28:40
问题 A while ago I made a function that you can call from the command prompt or any batch file (it was just for fun, I don't see how it could be useful). It basically just makes your (Microsoft) computer speak whatever you wrote in as the parameter. I recently got some inspiration to add a switch to it where it would read the contents of a file. My standalone script worked, but when I added it to my function, it didn't work as I would have liked. Here's the code: @echo off & setlocal

Force messagebox to foreground

混江龙づ霸主 提交于 2021-01-29 09:22:44
问题 I've got a VBScript that calls a Visual FoxPro Instance and runs a VFP program. Part of this program produces a messagebox. However, if my script is run from the Windows GUI (rather than a Command Prompt), then the message box produced doesn't necessarily come to the foreground. In VBScript I have the following code: Set oVFP = CreateObject("VisualFoxPro.Application") oVFP.DoCmd("Messagebox('Hello World')") Set oVFP = Nothing When I run this script from a DOS prompt, the message box pops to

PowerDesigner - Assign a TriggerTemplate to a trigger through VBScript?

我与影子孤独终老i 提交于 2021-01-29 06:11:02
问题 In PowerDesigner v12, how would one, through use of VBScript, assign a TriggerTemplate to triggers that are missing the definition? We have a script now that can loop through the triggers and display the triggertemplate (if it has one), but all attempts to assign a template to these triggers have failed. Any insight would be greatly appreciated! Can someone with power edit this and add 'powerdesigner' as a tag? I can't do it. Thanks, Calvin 回答1: I may have found an answer, but I want to get

Start Outlook Command Line Switches Parameters And Launch Macro

隐身守侯 提交于 2021-01-29 04:27:42
问题 I'd like to open outlook via command with parameters and launch macro once is opened... this code open outlook with parameters outlook.exe /c ipm.note /m "m@m.m&subject=abc&body=123" /a "f:\attach.txt" if I add code to launch a macro, outlook won't open and give me an error... what's wrong in this code ? outlook.exe /c ipm.note /m "m@m.m,&subject=abc&body=123" /a "f:\attach.txt" /autorun mymacro 回答1: You can't run a macro using a command-line switch. The only relevant command is /altvba, but

Get element by tag name

一个人想着一个人 提交于 2021-01-28 21:31:45
问题 I have a trouble getting an element from HTML page what I do is I navigate to a site then I want to find an element called "jobId" Dim inputs Set IE = WScript.CreateObject("InternetExplorer.Application") IE.Visible = 1 IE.Navigate "SOME SITE" then I want to loop through the site ( HTML CODE ) Set inputs = IE.Document.GetElementsByName("input") x = msgbox(inputs) x = msgbox(inputs.Length) For each Z in inputs x = msgbox("Item = "+Z,64, "input") next on the first msgbox I get an error of

Trying to use Shell object and FileSystemObject in VBScript for file manipulation

一个人想着一个人 提交于 2021-01-28 19:51:36
问题 I am trying to recursively loop through hundreds of directories, and thousands of JPG files to gather sort the files in new folders by date. So far, I am able to individually GetDetailsOf the files using the Shell NameSpace object, and I am also able to recursively loop through directories using the FileSystemObject. However, when I try to put them together in functions, etc, I am getting nothing back when I try to get the DateTaken attribute from the photo. Here is my code so far:

Current charset of the windows script host

落花浮王杯 提交于 2021-01-28 19:32:02
问题 I write script (js or vbs, not significant) with Windows Script Host that creating .bat file. I want to convert ANSI string to OEM with ADODB.Stream I may get current OEM code page with Split(CreateObject("WScript.Shell").Exec("cmd /c chcp").StdOut.ReadAll, ":")(1) and then convent it to charset with http://msdn.microsoft.com/en-us/library/windows/desktop/dd317756%28v=vs.85%29.aspx. How I may get the current ANSI(script) charset? 回答1: The Windows codepage can be determined via WMI, by reading