Windows 10: Script returns a System.IO.DirectoryInfo data instead of the string when it should...

Discus and support Script returns a System.IO.DirectoryInfo data instead of the string when it should... in Windows 10 Software and Apps to solve the problem; I have the following script; which option 1 and 2 work correctly, but option 3, in which the user is expected to enter the directory name, does not... Discussion in 'Windows 10 Software and Apps' started by WalterNuñez1, Oct 15, 2023.

  1. Script returns a System.IO.DirectoryInfo data instead of the string when it should...


    I have the following script; which option 1 and 2 work correctly, but option 3, in which the user is expected to enter the directory name, does not work... this is my script: function Set-Destination { param [string]$dockroot $destinationPath = Join-Path -Path $scriptDirectory -ChildPath "/project/$dockroot" if -not Test-Path -Path $destinationPath -PathType Container { New-Item -Path $destinationPath -ItemType Directory } } function Get-DirectoryRoot { Write-Host "`n Set your DocumentRoot directory." -ForegroundColor "Red" Write-Host " Y

    :)
     
    WalterNuñez1, Oct 15, 2023
    #1

  2. auto trivia restart script?

    I know everyone is so busy here so I'm suggesting an auto restart script so trivia is a benefit instead of a burden. Can anyone make this script?
     
    vectoravtech, Oct 15, 2023
    #2
  3. ordering strings alphanumerically

    You don't loop it, it does via .Sort(IComparer). In my example, it would like like...
    Code: List<string> list = new List<string>(); list.Add("2"); list.Add("1"); list.Add("0"); //sort it OffsetLengthPairComparer comparer = new OffsetLengthPairComparer(); list.Sort(comparer);[/quote] Obviously my comparer doesn't work for strings because it is for a custom type but, you get the idea.
     
    FordGT90Concept, Oct 15, 2023
    #3
  4. Script returns a System.IO.DirectoryInfo data instead of the string when it should...

    Wanted: Sample scripts to cannibalize

    I need to create a simple (I hope) script and have it working in less than 2 weeks. I'm not terribly proficient in any scripting language but am comfortable with .bat scripts and can stumble around in .vbs (given good samples). PowersShell might as well be Sanskrit. (I know I should learn PS but the learning curve is too long for this project.) JavaScript is another possibility. I've never used it, but I suspect it has a shorter learning curve than PS. The script needs to
    1. Present and process a file selection display of some sort. It would be ideal if it looked and felt similar to File Explorer but I'll accept anything that works.
    2. Open a file, read the data, and close the file.
    3. Modify the data read in step 2. The data will be a number of file paths - local, not UNCs.
    4. Open a file, write data (overwriting, if it already exists), and close the file. (I assume steps 2, 3, and 4 will happen concurrently.)
    5. Invoke a program (as though using "Open With" in File Explorer) to process the data written in step 4.
    I'm sort of envisioning this as an HTA, but I could use anything that works. I'm not worried about steps 2, 3, and 4; I'm sure I can get that part to work. I have no idea how to do step 1 although I'm sure it can be done. A lot of applications do that. I am most worried about step 5. I have no idea how "Open With" passes the selected file's path to the program or the program accesses that data. (Is it just like calling a program with an argument?) I will be writing this on Win10 21H1 (build 19043.1348) but it will have to run on some very old computers running Win7, on newer computers running Win10, and probably eventually on Win11. Are there some scripts around that I can use as models?
     
    pokeefe0001, Oct 15, 2023
    #4
Thema:

Script returns a System.IO.DirectoryInfo data instead of the string when it should...

Loading...
  1. Script returns a System.IO.DirectoryInfo data instead of the string when it should... - Similar Threads - Script returns System

  2. Windows search shows Resource URI instead of localized String

    in Windows 10 Gaming
    Windows search shows Resource URI instead of localized String: I got a new ASUS Vivobook Pro 15 OLED 15.6" with an Ultra 9 185H processor, 24GB RAM, 2TB SSD, and an RTX 4060. The laptop came with Windows in Hebrew, and I changed the language to English. Now, almost everything is in English, but I still have an issue with the search...
  3. Windows search shows Resource URI instead of localized String

    in Windows 10 Software and Apps
    Windows search shows Resource URI instead of localized String: I got a new ASUS Vivobook Pro 15 OLED 15.6" with an Ultra 9 185H processor, 24GB RAM, 2TB SSD, and an RTX 4060. The laptop came with Windows in Hebrew, and I changed the language to English. Now, almost everything is in English, but I still have an issue with the search...
  4. Accidentally installed another system on/instead of windows, how to return windows, my...

    in Windows 10 Gaming
    Accidentally installed another system on/instead of windows, how to return windows, my...: Windows 10 operating system was installed on my laptop, there was one disk C:. I installed Proxmox Virtual Environment on the single disk I had by boot manager. I didn't know that it would delete Windows. How can I restore windows, existing applications and personal files? I...
  5. Accidentally installed another system on/instead of windows, how to return windows, my...

    in Windows 10 Software and Apps
    Accidentally installed another system on/instead of windows, how to return windows, my...: Windows 10 operating system was installed on my laptop, there was one disk C:. I installed Proxmox Virtual Environment on the single disk I had by boot manager. I didn't know that it would delete Windows. How can I restore windows, existing applications and personal files? I...
  6. Accidentally installed another system on/instead of windows, how to return windows, my...

    in Windows 10 Installation and Upgrade
    Accidentally installed another system on/instead of windows, how to return windows, my...: Windows 10 operating system was installed on my laptop, there was one disk C:. I installed Proxmox Virtual Environment on the single disk I had by boot manager. I didn't know that it would delete Windows. How can I restore windows, existing applications and personal files? I...
  7. Script returns a System.IO.DirectoryInfo data instead of the string when it should...

    in Windows 10 Gaming
    Script returns a System.IO.DirectoryInfo data instead of the string when it should...: I have the following script; which option 1 and 2 work correctly, but option 3, in which the user is expected to enter the directory name, does not work... this is my script: function Set-Destination { param [string]$dockroot $destinationPath = Join-Path -Path...
  8. Windows search shows Resource URI instead of localized String

    in Windows 10 Gaming
    Windows search shows Resource URI instead of localized String: See attached screenshot. When I search for "language", I don't see the localized name of the settings menus but it's URI. How to fix this?***** moved from german to english Community *****...
  9. Windows search shows Resource URI instead of localized String

    in Windows 10 Software and Apps
    Windows search shows Resource URI instead of localized String: See attached screenshot. When I search for "language", I don't see the localized name of the settings menus but it's URI. How to fix this?***** moved from german to english Community *****...
  10. IoGetDeviceProperty returns empty string for DevicePropertyFriendlyName on Windows 10 Pro...

    in Windows 10 Drivers and Hardware
    IoGetDeviceProperty returns empty string for DevicePropertyFriendlyName on Windows 10 Pro...: This property that fetches the friendly name for removable USB storage media by calling IoGetDeviceProperty with DevicePropertyFriendlyName is broken in Windows 10 Pro x64 2004 19041.329. Earlier versions of Windows 10 are fine. Is this a known problem? Is there a fix...