Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


TG09

234 posts

Master Geek


#125745 18-Jul-2013 10:00
Send private message

Hi Lads,

Need a hand,

I need a VBscript. That will unhide a zip file and then unzips it in to the C drive where the zip file it.

We have this zip file on loads of workstations, and need a way to unzip it and run the file I am thinking. The user will be a domain admin, so permissions wont be a issue.

I need a way that is easy and the engineer on site, wont have to do too many tasks.

Would this be the best way to do it, so the engineer doesnt have to do too much, basically I want a one click method that is easy for the engineer.

Create new topic
Lias
5589 posts

Uber Geek

ID Verified
Trusted
Lifetime subscriber

  #858559 18-Jul-2013 12:09
Send private message

Not a 2 minute trivial piece of code that someones likely to knock up for you for free (hey you never know, but I wouldn't hold my breath)

TBH your best bet is to try and build it yourself, VBS isn't that hard to learn, and if your in a system admin type job, you should really know how to use it yourself.




I'm a geek, a gamer, a dad, a Quic user, and an IT Professional. I have a full rack home lab, size 15 feet, an epic beard and Asperger's. I'm a bit of a Cypherpunk, who believes information wants to be free and the Net interprets censorship as damage and routes around it. If you use my Quic signup you can also use the code R570394EKGIZ8 for free setup.




TG09

234 posts

Master Geek


  #858571 18-Jul-2013 12:22
Send private message

Hi there,

I know vbscript, just thought that might be a easier appoarch to my issue.

all good I have something in the making at the moment.

Ta

timbosan
2159 posts

Uber Geek


  #858597 18-Jul-2013 13:11
Send private message

As 'lias' says, this is not an easy piece of work, several things spring to mind (having done this type of work before many times)

Target location - what happens in the account doesn't have rights?
What happens if disk space is not available?
What happens in the ZIP file isn't there?
What logging is required?
What happens in no-one is logged in? Does it run as a service account?  if so does it log to the event log?


The actual VBScript to unzip it could be as simple as 1-2 lines, however all the checks will expand it out a lot.  If you want some help I am happy to lend a hand.



TG09

234 posts

Master Geek


  #858613 18-Jul-2013 13:39
Send private message

Cool cheers,

I think I have it sorted with this


Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")

If Not fso.FolderExists("H:\Test") Then fso.CreateFolder("H:\Test")
set sa=CreateObject("Shell.Application")
set filesInzip=sa.NameSpace("H:\Test.zip").items
sa.NameSpace("H:\Test").CopyHere(filesInzip)


I am going to use the variable %SystemDrive% instead of hardcoding it. I just used H:\ as I was running it of my memory stick.

Lias
5589 posts

Uber Geek

ID Verified
Trusted
Lifetime subscriber

  #859607 18-Jul-2013 13:57
Send private message

If your going to roll that to multiple workstations in an enterprise you should probably seriously consider wrapping a fair bit of error checking and logging around that :-)





I'm a geek, a gamer, a dad, a Quic user, and an IT Professional. I have a full rack home lab, size 15 feet, an epic beard and Asperger's. I'm a bit of a Cypherpunk, who believes information wants to be free and the Net interprets censorship as damage and routes around it. If you use my Quic signup you can also use the code R570394EKGIZ8 for free setup.


TG09

234 posts

Master Geek


  #859627 18-Jul-2013 14:10
Send private message

Updated to 
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")

If Not fso.FolderExists("H:\Test") Then fso.CreateFolder("H:\Test")
set sa=CreateObject("Shell.Application")
set filesInzip=sa.NameSpace("H:\Test.zip").items

Const OverwriteExisting = TRUE

If Not fso.FolderExists("H:\Test") Then
sa.NameSpace("H:\Test").CopyHere(filesInzip)
msgbox "Created!"
else
If fso.FolderExists("H:\Test") Then fso.DeleteFolder("H:\Test")
If Not fso.FolderExists("H:\Test") Then fso.CreateFolder("H:\Test")
sa.NameSpace("H:\Test").CopyHere(filesInzip)
msgbox "All ready created, overwritten!"
End if

Wanted to use the Overwriteexisting bit if it already existed but couldnt get it working so just did the above. Delete folder then create folder.

Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.