Vbs Script to check if a folder exist and then run a file

后端 未结 3 1775
北荒
北荒 2020-12-16 03:53

Hello I\'m new here I need a script to check, if a folder exist and then run a file from the folder. If not, it should extract a ZIP file into a specific location. Thanks in

3条回答
  •  眼角桃花
    2020-12-16 04:16

    If I understand correctly : create a script: sudo vim script.sh

    #!/bin/bash
        echo "enter your path"
        read path
    
        if [[ -d "$path"  ]]
                then
                echo $(sudo $path/yourprograme)
                else
                echo "enter your specific location"
                read spec
                $ mkdir -p $spec
                $ unzip yourfiles.zip -d $spec
    
                fi
    

    run the scrip.sh : sudo ./script.sh

提交回复
热议问题