Results 1 to 1 of 1

Thread: , !

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    If it ain't broke o/c it WoW's Avatar
    Join Date: Jun:2004
    Location: Motor City
    Posts: 1,980

    , !

    VBScript , . .
    , .
    :
    Code:
     
    Dim fso, ws, Args, clip, Title
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ws = CreateObject("Wscript.Shell")
    Set Args = WScript.Arguments
    Set clip = CreateObject("WshExtra.Clipboard")
    Title = "Create New Folder"
    Call MakeNewFolderClipboard
    Call Cleanup
    Sub MakeNewFolderClipboard
      Dim NewFldr
      NewFldr = clip.Paste()
      If NewFldr = "" Then Call Cleanup
      On Error Resume Next
      fso.CreateFolder fso.GetFolder(Args(0)) & "\" & NewFldr 
      If Err.Number = 58 Then
        Err.Clear:On Error GoTo 0
        ws.Popup Chr(34) & NewFldr & Chr(34) & " already exists.", ,Title, 0 + 48 + 4096
        Call MakeNewFolderInputBox
        Exit Sub
      ElseIf Err.Number = 52 Then
        Err.Clear:On Error GoTo 0
        ws.Popup Chr(34) & NewFldr & Chr(34) & " contains invalid character(s).", ,Title, 0 + 48 + 4096
        Call MakeNewFolderInputBox
        Exit Sub
      End If
      ws.Run fso.GetFolder(Args(0)) & "\" & NewFldr
    End Sub
     
     
    Sub MakeNewFolderInputBox
      Dim NewFldr
      NewFldr = InputBox("Name for New Folder?", Title, "New Folder")
      If NewFldr = "" Then Call Cleanup
      On Error Resume Next
      fso.CreateFolder fso.GetFolder(Args(0)) & "\" & NewFldr
      If Err.Number = 58 Then
        Err.Clear:On Error GoTo 0
        ws.Popup Chr(34) & NewFldr & Chr(34) & " already exists.", ,Title, 0 + 48 + 4096
        Call MakeNewFolderInputBox
      ElseIf Err.Number = 52 Then
        Err.Clear:On Error GoTo 0
        ws.Popup Chr(34) & NewFldr & Chr(34) & " contains invalid character(s).", ,Title, 0 + 48 + 4096
        Call MakeNewFolderInputBox
      End If
      ws.Run fso.GetFolder(Args(0)) & "\" & NewFldr
      Call Cleanup
    End Sub
    Sub Cleanup
      Set ws = Nothing
      Set fso = Nothing
      Set Args = Nothing
      Set clip = Nothing
      WScript.Quit
    End Sub
    :
    Code:
    [HKEY_CLASSES_ROOT\Directory\Background\shell\NFC]
    @="New Folder from Clipboard"
    "NoWorkingDirectory"=""
    [HKEY_CLASSES_ROOT\Directory\Background\shell\NFC\command]
    @="C:\\Windows\\SysWOW64\\wscript.exe \"C:\\Users\\USER\\Documents\\My VBScripts\\mkdir.vbs\" \"%1\""
    [HKEY_CLASSES_ROOT\Folder\shell\New Folder from Clipboard]
    [HKEY_CLASSES_ROOT\Folder\shell\New Folder from Clipboard\command]
    @="C:\\Windows\\SysWOW64\\wscript.exe \"C:\\Users\\USER\\Documents\\My VBScripts\\mkdir.vbs\" \"%1\""
    32 wscript.exe. W7 64 , 32 ( 64 ), WSH .
    :
    1. , , - , (). , , ...? ...
    : . .

    2. - . / (folder tree) , / :



    32 dll - . , 32 ...
    cmd- . WSH .

    [HKEY_CLASSES_ROOT\Directory\Background\s hell] ?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	error.jpg‎ 
Views:	177 
Size:	78.7 KB 
ID:	26245  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |