![]()
[<<]Message[>>] [<<]Author[>>] Subject[>>] Thread[>>]
Number : 10640 Date : 2005-02-26 Author : des4212001 Subject : Possible to Assign Batch Parameters from WSH? Size(KB) : 1
Drag & Drop is a really neat feature of WSH, allowing argument passing directly from Windows. But there appears to be no Renaming method in WSH? I was doinking around trying to see if I could pass the WSH arguments to batch paramenters... Set WshShell = WScript.CreateObject("WScript.Shell") Q = Chr(34) : CR = Chr(13) For Each Source in WScript.Arguments Input = InputBox("Enter new name ?") Source = Q+Source+Q Input = Q+Input+Q WScript.Echo Source & CR & "Rename to " & Input WshShell.Run "%windir%\System32\Cmd.exe /K CD C:\ & Rename % Source% %Input%",1,true Next This kind of thing doesn't work because CMD can't resolve the WHS arguments there. CMD sees literaly "%Source%" & "%Input%", not they're values. But I "feel" there must be a way to pass the arguments? I have a little script that copies whatever is selected & droped on it to my backups. Actually through a shortcut to it added to the Send To menu. Limited only by the argument list length and very useful. I was thinking about others to automatically rename & delete the multiple copies. The delete method exists and would be no trouble, but I can't find any rename? There's probably a work a round but it hasn't poped out yet! DES
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.