Jump to content

(VBS) Getting WScript.Run to work anywhere?

Newbie user here, I've been fiddling around with VBS, mostly making joke viruses (Windows 9) And I've been using stuff like:

wscript.run "C:\folder\file.vbs"

However, this only works in a specific file path. If for example, file A was in documents, and wanted to run file B, which was in downloads. Then, a user moves file B to say, desktop. file A can no longer run file B because it's file path has moved. Is there a way to make it so file A could always find file B, sort of like the way WIN+R can?

Edited by TheCarGuy
Accidental early post
Link to comment
https://linustechtips.com/topic/1464141-vbs-getting-wscriptrun-to-work-anywhere/
Share on other sites

Link to post
Share on other sites

35 minutes ago, Sakuriru said:

You could search the entire file tree for the file you're looking for.

 

Normally how this is handled is through some kind of config file so the user can specify where the file is located.

Could you explain how to do the file tree thing? 😅

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×